We follow something along the lines of the 2017 version of https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/.
Make sure your ~/.pypirc
is set up like this
[distutils]
index-servers=
pypi
test
[test]
repository = https://test.pypi.org/legacy/
username = <your test user name goes here>
[pypi]
username = __token__
pip install twine -U
rm -rf build dist
python setup.py sdist bdist_wheel
twine upload -r test --sign dist/*
In a different virtualenv, test that you can install it:
pip install -i https://testpypi.python.org/pypi jsonobject-couchdbkit --upgrade
twine upload -r pypi --sign dist/*