Publishing
Publish a Python package
Upload wheels and source archives with twine.
The same rules apply as for npm: a publisher role and a reserved project name. Upload to https://packages.example.com/pypi/.
$ ls dist acme_tools-1.1.0-py3-none-any.whl $ twine upload --repository-url https://packages.example.com/pypi/ -u __token__ -p "$REPO_TOKEN" dist/* Uploading distributions to https://packages.example.com/pypi/ Uploading acme_tools-1.1.0-py3-none-any.whl
Captured by running these commands against a real ForgeRepo™.
~/.pypirc
[distutils]
index-servers = company
[company]
repository = https://packages.example.com/pypi/
username = __token__
With that file, run twine upload -r company dist/* and twine asks for the token, or reads it from TWINE_PASSWORD.