Publishing Python software to PyPI

Short notes on how to build and publish Python packages to the Python Package Index (PyPI).

Using Poetry

Use poetry build and poetry publish. For more information, see

Using Twine

  • Build source distribution and binary wheel: python3 -m build
  • (Optional) Upload to test PyPI: twine upload --repository testpypi dist/*
  • Upload to PyPI: twine upload dist/*