Repository navigation
Preserve original constraint declarations in Constraints - #21459
Merged
Merged
Conversation
zsol
marked this pull request as draft
September 4, 2026 12:21
uv test inventory changesThis PR changes the tests when compared with the
|
zsol
marked this pull request as ready for review
September 4, 2026 16:21
zsol
force-pushed
the
zsol/preserve-constraint-hashes
branch
from
September 7, 2026 13:08
f7bb464 to
8827257
Compare
konstin
reviewed
Sep 8, 2026
zsol
force-pushed
the
zsol/preserve-constraint-hashes
branch
from
September 10, 2026 10:37
f144681 to
d29c20a
Compare
Constraints
konstin
approved these changes
Sep 14, 2026
| let constraints_txt = context.temp_dir.child("build_constraints.txt"); | ||
| constraints_txt.write_str("setuptools>=40")?; | ||
| // Verify mode ignores hashes on unpinned constraints and does not activate extras. | ||
| constraints_txt.write_str("setuptools[foo]>=40 --hash=sha256:incorrect")?; |
Member
There was a problem hiding this comment.
More for a follow-up PR, but that looks like a footgun: I spelled out the hash I want, and I said I want that hash verified, but it ignores that silently.
Member
Author
There was a problem hiding this comment.
Yes I completely agree with you
zsol
force-pushed
the
zsol/preserve-constraint-hashes
branch
from
September 15, 2026 10:02
46fd0fd to
83fa013
Compare
zsol
added a commit
that referenced
this pull request
Sep 15, 2026
…21467) ## Summary Project build constraints can pin versions, but cannot attach hashes to those pins. Allow `build-constraint-dependencies` to contain `{ requirement, hashes }` entries alongside strings, and retain the hashes in `uv.lock` and tool receipts. Verify supplied hashes when uv downloads build dependencies for project, script, build, pip, and tool commands. This includes the build used to infer a tool's name and fresh `uv run --no-sync --with` overlays. Build dependencies without supplied hashes remain allowed. Stacked on #21459.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Constraintscurrently stores only normalized requirements for resolution, with extras and empty constraints removed. Callers that need the original declarations and their hashes have to keep a separate collection.Preserve the original
NameRequirementSpecifications in input order alongside the resolver map. Use this representation for build constraints inuv pip install,uv pip sync, anduv build, preserving their existing hash-checking and resolution behavior.