I’ve finally caught up on this thread . There’s no way I can or will comment on everything said here .
I will add one perspective that I haven’t seen addressed. I work for BigCorp and we are currently in the process of revamping our Python build system, in order to ditch some painful legacy wrappers and adopt native Python tooling. We have probably a handful of senior Python experts with varying biases and experiences, so while we are converging on some decisions, we each prefer the tools we’re familiar with.
And that’s okay because frankly, any of pdm/hatch/poetry would be just fine . One distinction made in this thread that I agree with is between “package manager” and “environment manager”. I.e. we could adopt say hatch and not need tox , although with pdm and poetry, we’d probably have to match that with tox. We’re angsting over the importance of features like lock files and the UX (or lack thereof) for managing dependencies; they are important, but eventually all the tools will have them, so how critical are they right now?
Essentially we act as a “distribution” (in Steve’s words) because we manage our own builds of CPython, and we internally mirror all PyPI packages we depend on, with a process for importing that includes things like license and security scanning. We build extension modules (both internal and external) against our CPython builds exactly to ensure they all work well together. Managing system dependencies is a challenge, but our plans for containers should hopefully make that workable for now. Even so, some external packages are (currently?) just too difficult to build from source, but we have a process for those handful of exceptions .
Yes, I would prefer to have a single tool that the entire community can help improve, but I’m very skeptical that will happen any time soon, if ever. In lieu of that, what I really want is more standardization around pyproject.toml
settings and lock file formats. I’m okay with pdm/hatch/poetry/pip innovating on the UX but what is really painful is having to modify pyproject.toml
if we (or one of our teams) chooses a different project manager. Those kinds of migrations and divergences are costly and time consuming. It’s bad enough for the open source projects I personally maintain.
So in practice what does this mean?
- Please standardize on the settings for dynamically calculating the version. I need to be able to call some custom Python code to calculate this at build time (which hatch supports), or grab it from the file system, or query the SCM. This seems like a perfect candidate setting to converge on.
- Please standardize how to specify what goes in my sdist and wheel. More generally, please at least standardize on the common settings for the build backends. Again, just start with things they all have in common today and we can deal with the things they innovate on later, as that all shakes out organically.
- We desperately need a lock file standard format.
- Please add some support for
pip
to read some settings out of pyproject.toml
, most urgently PIP_INDEX_URL
, PIP_EXTRA_INDEX_URL
, PIP_TRUSTED_HOST
and PIP_CERT
. Yes I can use pip.conf
but the more configuration files I have to manage, the more complex my problem becomes for migrations and such. PDM is nice here, hatch is trickier.
- This one’s harder because of the philosophical differences (see my comment about hatch vs pdm+tox), but standardizing on dependency specifications would be a big plus.
- Another difficult one, but having standard plugin settings and APIs would go a long way to improving things.
TL;DR - concentrate less on converging the tools and more on standardizing the settings and APIs. Ironically, the PEP process was originally designed to be very lightweight , but it hasn’t turned out that way, so come up with a really lightweight way to evolve the standards. It’s okay to innovate around the edges and on the UX. Make it less painful to switch tools.