No, it doesn’t. It will, as you say, build the wheel. But under the proposed rules (and assuming an updated build backend that implements the new rules), the wheel will change, and that’s the problem. The user did nothing to opt into the new rules, and now the build fails. That’s what I think is unacceptable.
It’s not about pip, it’s about the fact that you’re silently changing the meaning of something the user has written in their project code (in pyproject.toml
). And worse, not only did the user not opt in, you don’t provide any opt-out.
Let me repeat what I just said. It’s not about core metadata. It’s about the fact that you cannot silently change the meaning of something that users are currently using extensively.
Currently a user can say one of two things:
- These are my project’s dependencies. They will be the same in every artifact built from this source code. Specified by giving
dependencies
an explicit value, and not incuding it in dynamic
.
- My project’s dependencies are calculated by the build backend. Specified by including
dependencies
in dynamic
and not providing a value.
You want to add something new that a user can say, and that cannot be done by using either of the existing spellings.
The only possible way of spelling this new intention without adding new keys to the [project]
table would be to assign a meaning to giving dependencies
a value and including it in dynamic
. That would mean modifying this statement in the pyproject.toml
spec:
Build back-ends MUST raise an error if the metadata specifies a key statically as well as being listed in dynamic
.
The change would need to explicitly call out dependencies
as being different (and that will likely cause some debate - why not allow it for other fields too, if we’re doing this? For example, optional-dependencies
…) You’d also need to define the particular rules that apply to dependencies
(the “you can only tighten restrictions on existing dependencies” rule).
To be honest, this seems like an awful lot of effort to standardise something that’s perfectly possible already:
[project]
dynamic = ["dependencies"]
[tool.my_build_backend]
base_dependencies = [...]
Seriously - if a build backend needs this, what’s wrong with just Dynamic: Requires-Dist
? I don’t like making dependencies dynamic, because of the performance implications, but the performance will be just as bad with this proposal (and probably worse, as you seem to be suggesting that wheels can have Install-Constraint
, and that will slow down getting the dependencies of a wheel, rather than limiting the impact to sdists).