We follow https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/ (Oct 2019 version).
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__
rm -rf build dist
python -m pep517.build .
twine upload -r test --sign dist/*
In a different virtualenv, test that you can install it:
pip install -i https://testpypi.python.org/pypi django-prbac --upgrade
twine upload -r pypi --sign dist/*