Skip to content

Python Toolchain

Ion Y edited this page Jan 24, 2022 · 1 revision

Python toolchain notes.

Packaging

Packaging in Python is really complex due to its history. It finally started to settle down and be modern after nearly decades of churn around 2019.

  • This is not just pip. pip allows installation but doesn't handle packaging and deployment.
  • It has a long and tangled history.
  • Modern Python packaging has benefited greatly from PEP 517 which standardized pyproject.toml as the entry point for build system configuration. You can identify a modern Python source tree by the presence and active usage of pyproject.toml.

Candidates

  • setuptools

    The de facto build system for Python builds in practice, adding many more needed features on top of distutils, with a complex evolution over many years. For a long time dependencies on the implementation setuptoolsmade build system alternatives un-workable.

    • Benefits: ...
    • Drawbacks: ...
    • Constraints: ...
  • pipenv

    One of the first significant alternatives to setuptools. Used by a lot of projects. Suffered from difficulties with project management and stalled development in 2018-2020 but is currently actively developed.

    • Benefits: ...
    • Drawbacks: ...
    • Constraints: ...
  • poetry

    Another significant alternative to setuptools. Actively developed since 2019.

    • Benefits: ...
    • Drawbacks: ...
    • Constraints: ...
  • flit

    Primary focus is on deployment to PyPI (it's a replacement for twine). Also allows building.

    Used by FastAPI.