PEP 722: Dependency specification for single-file scripts

I agree with those 2 points (very important in my opinion):

I do not understand why tools like Poetry or Hatch would care about PEP 722 in the short term. Maybe there is a use case, but it is not obvious to me just yet. At least that is not at all my expectation that Poetry or Hatch should support PEP 722.

There is a whole world of things that can be written in a pyproject.toml file (the [tool:XXX] sections and [build-system]). It is already quite unclear how [project] could fit in a single-file script use case (see also “Projects that aren’t meant to generate a wheel and pyproject.toml” again). But I get a headache thinking what would happen if we said everything that goes in pyproject.toml can now be written inside any Python script. What if users expect that all tools that store their config in [tool:XXX] to also support the embedded version? Would that be the expectation from the PEP? If it is a subset of pyproject.toml that is allowed to be embedded, which subset?

Of course, I can see the appeal of having the configuration settings of things like linting, formatting, or maybe even whole packaging metadata (including build system) into a single file script, but that is a very different scope than what PEP 722 is aiming for. And I guess theoretically it could work, and if it were to happen that could be great. But in practice I can see quite a bit of chaos happening.

If people want to pursue this path, fair enough, I am not against it (for what it’s worth), but clearly it can not be written within a week (it might well be that the “within a week” was not meant literally, but for sure don’t take my quoting of it literally). I believe there is a whole bunch of things that need to be clarified, in my opinion this would be on a completely different scale compared to PEP 722. If it has to be, then let’s drop PEP 722 and restart from scratch with proof of concepts implementations, soft approval from tools and so on.


Aside: Maybe I am wrong, but I feel like people are writing pyproject.toml when they actually mean only its [project] section, and it is a bit frustrating to me, because then it feels to me like people are talking past each other: good arguments are made but ignored and bad arguments are made but not refuted. I know I have written this a couple of times already in this past few days, but I feel like it important to be repeated.

4 Likes