Why doesn't pip write installed packages to pyproject.toml?

For those reading this who are young enough in their Python careers, and therefore lucky enough, not to have seen it before, here’s a snippet from get-pip.py (which is still available!) which may help shine a light on what some of the history here looks like:

# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version 23.3.2).

This used to be The Way to get pip, as @ncoghlan was saying.

It’s great to push for improvements. And asking for something doesn’t require that you know all of the background.

Understanding why some features are accepted and others are not often does require learning quite a bit though.

pip’s place in the world is unique to it. We may compare it with other language tools (e.g. cargo), but it’s the only Python tool with its history and position vis-a-vis cpython.

A few years ago, on GitHub, I was part of a group of users who (somewhat loudly) asked for a pip publish command. It seemed easy. twine was already maintained by “the same people”, the code was written, the interface seemed more or less trivial, etc etc. That was my first time interacting with some of the folks on this forum. They explained why it was not obviously a good feature, why it is more complicated than it seems, and perhaps some other details I’m forgetting.
I didn’t get it at the time, but I do now.

My story has three purposes:

  • For the pip maintainers, please keep explaining pip to people! It’s a lot of work to explain things. Sometimes it won’t bear fruit immediately. But it is worth doing.
  • For those asking questions, I encourage you to treat this primarily as an opportunity to learn more about the ecosystem. If your goal is to change things, without a broad view of the problem space, your odds of coming away disappointed are high. Remember that “I learned some stuff that will help me contribute in the future” is a win.
  • Do we need some write-up somewhere on “Why pip is not a workflow tool”? Like I said, the energy poured into explaining things is great and a good investment. But I worry about the cost of having to explain this in different ways to different people, over many years. Maybe we can make the process less taxing for community members?