Thanks for your detailed feedback! And thanks for reading the thread – it’s quite long, so I hope not too many people feel the need to read it all, but it does contain useful context.
There’s a lot of ground to cover, so let’s get right to it.
Would it suffice to note and clarify that this is how the PEP speaks? requirements.in
has become much more common in recent years, but I don’t think it qualifies as a district file format.
Dependency Groups may be locking inputs, but not every project pins dependencies.
I think all you’re asking for is to have the PEP clarify this, but please correct me if I’m mistaken.
There are two subtleties here which I think are important. One is that extras can only be reliably extracted by being ready to invoke build hooks, since they may be defined dynamically. The other is that they are defined in the [project]
table, which means that for projects which do not have that table (because they are not built packages), adding extras requires newly defining themselves as packages.
I’m open to altering the text, but some of the important benefits of Dependency Groups are that they are guaranteed to be static and external from the [project]
table. These distinguish them from extras.
I think this is fine / expected. I wanted to write things such that an expansion of the spec would have minimal impact on a project, but I’ve become a bit doubtful that’s how it would play out in practice. Even a simple lint tool immediately needs to read all of the data.
I don’t think the spec needs to change in what it requires, or even in recommending that tools refrain from eagerly reading the whole table if they don’t need it, but perhaps it should simply de-emphasize this point. I’ll review this section in the coming days to see about some edits.
I understand wanting a better UX than two commands for this case. But isn’t this a matter of defining an environment or workspace, and declaring that environment to require the project + one of its dependency groups? I’m unclear on how the spec is failing you in this case.
If I understand your locking concern correctly, you’re saying that it’s important to know whether or not the Dependency Group should be locked in a way which is compatible with the project dependencies, or if it should be locked independently. Neither seems safe to assume, since a dependency group could be incompatible with [project.dependencies]
or could be required to be compatible. I need to think more about this, as it’s not a familiar problem-space to me right now.
First off, this is relatively new text and little-discussed, so it’s very likely that it can be improved.
There’s no guarantee that a tool reading [dependency-groups]
can read [project.optional-dependencies]
(in the dynamic case). Therefore, requiring tools to error or warn doesn’t seem feasible. And there’s no guarantee that Dependency Groups and Extras are mixed into the same usages, since that depends on the tool, so it’s unclear what a spec-mandated precedence order would mean.
I’m more attached to the first sentence in the text than any of the rest of it. Would it be acceptable to simply remove the note on tools defining their own semantics, and flip the SHOULD NOT
to a MAY
?
Note that this specification does not forbid having an extra whose name matches a Dependency Group. Users are advised to avoid creating Dependency Groups whose names match extras. Tools MAY treat such matching as an error.
I think it has to remain open, but I’m okay with the spec guiding towards implementations treating this as bad usage.
I’m basically out of time to reply at the moment, so I’m not able to get into full detail on the decision to allow includes from the [project]
tables, but I’ll give a small note to point at something which drove this.
A major concern I had was what the landscape looks like if this feature is omitted today and added in a following spec, “PEP N”. Then the situation for tooling becomes more difficult for users, as some tools “Support PEP 735 Dependency Groups but not PEP N” and other tools “Support PEP 735 Dependency Groups and PEP N”.
If the feature itself is not wanted (I have my opinion, but I’m open to being convinced), then there never would be such a “PEP N” and this concern disappears.