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 https://python-poetry.org/.

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/*

References