Hi Anderson. I haven’t had the time yet to fully digest your response, but I have been thinking some more about what my reservations are, and I think my conclusions link to this point. So I’ll post my current thinking here, but defer responding to your other points until I’ve had more time to think about them. I hope that’s OK.
A key part of my reservations here is that we’ve had a number of threads recently which have demostrated pretty clearly that we have no community consensus that PEPs are appropriate for defining user interface for tools.
PEP 621 is pretty close to being precisely that, and this proposal (particularly the part that specifies tool specific parameters) is even more so. I think that, in order to resepect the (lack of) community consensus, we need to look at PEP 621 and this proposal more in terms of being an interoperability standard.
In that context, PEP 621 is a way for projects to define, in a standardised form, project metadata that is present in the source tree and guaranteed to be in all artifacts built from that source tree. Static metadata defined in pyproject.toml
can be read by any tool simply by reading the standard elements of that file.
The dynamic
list isn’t specifying metadata, as such, it’s simply distinguishing between “explicitly not present” and “not specified”. Maybe this wasn’t the best way of doing this (there was an active debate over whether static or dynamic should be the default) but it’s how we ended up specifying this distinction.
Importantly, everything that PEP 621 specifies can be consumed by any tool, even tools not written in Python. The consumer may be told “there’s no static value available for this metadata item, it potentially varies depending on what built artifact you select”, but that’s still a valid answer for “what is the value of this field?”
To address your point about dynamic
making pyproject.toml
backend specific, that’s valid up to a point. The PEP 621 metadata (in effect) says that it’s the responsibility of the build system to fill in any required dynamic
fields as part of the build. The user then has to specify a build backend that satisfies that requirement, and if they don’t do so, the build won’t work. But that’s no different from a mis-spelled build backend - for tools that don’t actually need to do a build, it’s not important. I concede that this is a fairly “lawyerish” way of explaining away this point, but importantly (to me, at least) it demonstrates that we can still preserve the tool-independence of the standard under this view.
Supporting this, we have a clear namespacing in pyproject.toml
. The root namespace is explicitly reserved for tool-independent standard information, and individual tools are assigned their own namespace to use as they see fit. This acknowledged the fact that tools might want to use pyproject.toml
for their own data, without requiring standards, or tools that relied solely on those standards, to have to handle unexpected or arbitrary additional data in standard-controlled areas.
The provider=xxx
part of the new proposal extends this relatively naturally, following PEP 517 in allowing tools to determine “what software do I need to generate this value?” It remains possible for any consumer to use this information - even non-Python tools could potentially start up a Python interpreter and call the named plugin using the defined plugin API.
The “provider-specific settings” part of the proposal, however, violates the principle established back in PEP 518 of clear separation between standards-defined data and tool-specific data. And I don’t think that is something we should do lightly. Maybe the tool.xxx
approach has turned out in practice to be somewhat clumsy and unsatisfying for real-world use. We can look at reserving other namespaces for tool use, or otherwise refining the UI aspects of pyproject.toml
.
I have some sympathy for the view that defining behaviour in pyproject.toml
can get over-complicated when faced with an array of backends, backend plugins, supporting tools, etc. But that seems to me to be a separate discussion, and one that leads right back into the contentious matter of standards defining UI. So I’d rather that it be kept separate, to avoid impacting the much simpler, core proposal that @henryiii suggests was the original intention here.
Agreed. I don’t think that putting all the various aspects into a single proposal is helping at all here
Precisely - this all feels more like a series of UI and implementation issues, rather than a standardisation matter. The only standardisation point I can see is “having separate [tool.xxx]
sections for different tools isn’t sufficient - can we redesign the tool-specific config provisions in the standard?” And we’d need a concrete proposal for that which had support from the majority of tools using pyproject.toml
for configuration (which is more than just build backends). So it should be an independent PEP.