Packaging Python modules and deploying them to PyPI is super easy.
First, ensure that all tests are passed.
cd ./tests pytest --disable-pytest-warnings cd ../
Make sure you have the latest versions of setuptools and wheel installed:
pip install --user --upgrade setuptools wheel
You will also need to install Twine:
pip install --user --upgrade twine
First, build the package from the same directory where setup.py is located:
python setup.py sdist bdist_wheel
Next, run Twine to upload all of the archives under dist:
shell python -m twine upload --repository testpypi dist/*
shell python -m twine upload dist/*
You will be prompted for a username and password. For the username, use
__token__. For the password, use your API key issued on PyPi, including the pypi- prefix. On Windows, when entering your password, right click the taskbar, then select
Paste, because other pasting methods do not work for this password field.