
However, you aren’t supposed to use setup.py files directly these days, you’re supposed to be using pip. It then added support for non-executable metadata specification formats: setup.cfg, and also pyproject.toml (partially still in beta). It previously used setup.py files to do its job, which required arbitrary code execution. Setuptools, probably the oldest tool of the group, and itself based on distutils, which is part of the standard library (although it will be removed in Python 3.12), is responsible for installing a single package. The classic Python packaging stack consists of many semi-related tools.

All of them with different authors, lineages, and often different opinions, although most of them are now unified under the Python Packaging Authority (PyPA) umbrella. There are many packaging-related tools in Python. PyPA versus reality: packaging survey results and PyPA reaction The part where the Steering Council kills it How are (system) Pythons and virtual environments related? How to use Python from a virtual environment? Tooling proliferation and the Python Package Authorityĭoes Python really need virtual environments? We’ll also take a glimpse at a possible future (with a venv-less workflow with PDM), and see if the PyPA agrees with the vision and insights of eight thousand users. We’ll also look at some examples of packaging and dependency-related workflows seen elsewhere (Node.js and. We’ll start by describing the classic packaging stack (involving setuptools and friends), the scientific stack (with conda), and some of the modern/alternate tools, such as Pipenv, Poetry, Hatch, or PDM. Join me on a journey through packaging in Python and elsewhere. But does it have to be this way? Are the current solutions to packaging problems any good? And is the organization behind most of the packaging tools and standards part of the problem itself? Many beginners are confused about virtual environments. Many have complained about the packaging ecosystem and tools making their lives harder. This is an area that has seen many different solutions pop up over the years, with many different opinions, wars, and attempts to solve it. There is an area of Python that many developers have problems with.
