-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locking of build dependencies #5190
Comments
I was going to raise this same issue as well. Currently This is causing real-life inconveniences in our organisation as, for example, new versions of (I will probably also raise a separate issue w.r.t the handling of 403 codes -- this is a pain point with |
Definitely agree that we should do this. |
I really want to do this (lock the build requirements). |
This fallback behaviour as documented in: - https://peps.python.org/pep-0517/#source-trees - https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour Once astral-sh/uv#5190 has been resolved the empty build-time specification & fallback behaviour will be replaced with the one from `uv.lock`.
This fallback behaviour as documented in: - https://peps.python.org/pep-0517/#source-trees - https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour Once astral-sh/uv#5190 has been resolved the empty build-time specification & fallback behaviour will be replaced with the one from `uv.lock`.
This is becoming more relevant with newer python versions that don't ship setuptools by default anymore |
I really want to do this and would like to spend time on it personally, but I'm worried about how it will intersect with PEP 751. |
Hmm but that's more about lockfiles in general, not specific to build-time deps? Correct me if I'm wrong but to me this PEP looks to be in early stages, and uv.lock looks way more mature as it is now. I would expect the introduction of this PEP to be orthogonal to the goal of being able to lock build dependencies - in the end if uv does decide to adopt the format, the build dependency group will probably be locked in a similar way to other dependency groups regardless of the final lock file format |
Last I saw build time dependencies were dropped from PEP 751: https://discuss.python.org/t/pep-751-lock-files-again/59173/222 (end of that post). I don't think anything changed: https://peps.python.org/pep-0751/#locking-build-requirements-for-sdists (FYI I really hope the "it confused enough people " isn't directed at me, I had some clarifying questions, and was mostly happy with the answers). |
@notatallshaw -- No, I agree with you, it's just that: if we add support for it here, what happens if PEP 751 comes out and we can't translate that support to the PEP? |
Could you use the space for tool specific data in the PEP 751 lock file? Or even using one of the main fields like |
Yeah, makes sense to see the finalized version of PEP 751 first. |
I mean, this wouldn't be the first feature that uv supports that vanilla python tooling doesn't. This is important enough to implement regardless of what python itself does; after all, even locking of regular dependencies is not really supported out of the box, doesn't mean that uv should be restricted by that |
similar proposals in poetry, pdm: python-poetry/poetry#8261 (and several duplicates), pdm-project/pdm#2465 I mostly think that people who care about reproducible builds would be better served by avoiding sdists altogether with |
Coming from #3611 (comment) and following comments.
Caveat: this is certainly not a complete proposal, and I reckon I have not investigated the capabilities of uv lock/sync in any detail, so consider this as thoughts to start the conversation on the usefulness of such features.
What
The
uv.lock
format supports locking source distributions (from sdists, git source trees, ...). This is great!I would find it useful that
Why
When installing from a lock file I expect that everything that the installation downloads (or obtains from cache) is checked against the hashes (or immutable VCS commit hashes) that are present in the lock file, for repeatability and security.
If, during installation, other artifacts are downloaded (or obtained from cache) without my knowledge (to build source distributions), the security and repeatability of the process is weakened.
Some thoughts
get_requires_for_build_{wheel,editable}
), further complicating the locking operationThe text was updated successfully, but these errors were encountered: