Warning: This note is for developer/maintainer of this package only
- If from scratch, using
pipenv
- Install pipenv
pip install pipenv
orpip3 install pipenv
- If fail, you may need to prefix the command with
sudo
- If fail, you may need to prefix the command with
- CD to project directory
- Install using pipenv
pipenv install
- If fail, you may need to specify which python bin file by
pipenv install --python /usr/bin/python3
. (Runwhich python
orwhich python3
to know the file path)
- If fail, you may need to specify which python bin file by
- Activate and enter python env for current folder
pipenv shell
, now you are inside python env - Install project as local package
pip install -e .
- Install pipenv
- Make your code changes
- Increase
version
value on:./setup.py
file./midtransclient/__init__.py
file./midtransclient/http_client.py
file on User-Agent value
- To install the package locally with a symlink
pip install -e .
- To run test, run
pytest
- To run specific test, e.g:
pytest -k "test_core_api_charge_fail_401"
- If fail, you may need to install pytest first
pip install pytest
- To run specific test, e.g:
- To update https://pypi.org repo, run these on terminal:
# install setuptools & wheel
python -m pip install --upgrade setuptools wheel
# Generate `dist/` folder for upload
python setup.py sdist bdist_wheel
# Update / install Twine
python -m pip install --upgrade twine
# upload to pypi / pip repository
# you will be asked for username and password for https://pypi.org account
twine upload dist/* --skip-existing
# To upload to test pypi use this instead
# twine upload --repository-url https://test.pypi.org/legacy/ dist/* --skip-existing;
- if fail to upload, clean up all files within your `./dist` folder, then re-try the above commands
- To use docker-compose to test and run project,
cd
to repo dir - Run
docker-compose up
, which basically run pytest on container - Run
docker-compose down
, to clean up when done
- need a better test cases / coverage
- check if any test cases break due to post-1OMS API behavior changes