First, bump the version in
setup.py and commit that change,
then use the following to tag that commit and push to remote:
git tag $(python setup.py --version) git push; git push --tags
These instructions are current as of 2017-10-22, and reflect the instructions from https://packaging.python.org/tutorials/distributing-packages/.
Generate reStructuredText re-formatting from canonical Markdown-formatted
pandoc README.md -o README.rst
Definitely the first time you do this, and probably every so often besides, you’ll want to install the required packages:
pip install -U twine wheel
Now we can build the source distribution and a universal (Python 2⁄3) “wheel”.
python setup.py sdist python setup.py bdist_wheel --universal
~/.pypirc includes your PyPI credentials. Then, finally:
twine upload dist/*