Repository navigation
Conversation
zsol
force-pushed
the
zsol/verify-build-constraint-hashes
branch
from
September 15, 2026 12:35
85b82da to
80bcb3e
Compare
zsol
force-pushed
the
zsol/hashed-uv-build-pins
branch
from
September 15, 2026 12:35
43e7794 to
21c665b
Compare
Base automatically changed from
zsol/verify-build-constraint-hashes
to
main
September 15, 2026 13:25
Use PEP 517 when an active build constraint pins and hashes a uv-build version different from the bundled version. Matching pins, unhashed or unpinned constraints, and --require-hashes alone remain eligible for bundled builds; --no-verify-hashes bypasses the constraint check. Share the check between uv build and BuildDispatch. Reject --list when the constraint selects an external backend.
zsol
force-pushed
the
zsol/hashed-uv-build-pins
branch
from
September 15, 2026 13:25
21c665b to
1abc0c6
Compare
uv test inventory changesThis PR changes the tests when compared with the
|
zsol
added a commit
that referenced
this pull request
Oct 9, 2026
Add `--require-build-hashes` to require an exact version or direct URL and a trusted hash for every build dependency, including transitive dependencies. This builds on the supplied-hash verification in #21467, which still allows dependencies without hashes. The requirement applies to builds run by project, build, tool, and pip commands, including builds needed to resolve metadata during locking or compilation. Hashes can come from `tool.uv.build-constraint-dependencies`, a `--build-constraint` file, or URL fragments in `build-system.requires`. Dependencies discovered through backend hooks or package metadata still need hashes declared upfront; hashes supplied only by those hooks or metadata do not satisfy the requirement. Enable the setting with `require-build-hashes = true` or the shared `UV_REQUIRE_BUILD_HASHES` environment variable. Pip commands can override the top-level setting in `[tool.uv.pip]`. CLI flags take precedence over the environment, which takes precedence over configuration. `--no-require-build-hashes` turns off the requirement without disabling verification of supplied hashes. This complements `--require-hashes` for runtime dependencies. The existing `uv build --require-hashes` behavior for command-line build constraints is unchanged. Requiring build hashes needs build isolation, except when uv uses its bundled `uv_build` backend, which is part of the executable. It does not retroactively verify installed packages or previously built wheels. The option is experimental and warns unless `--preview-features build-dependency-hashes` is enabled. Stacked on #21708. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
astral-automations-bot Bot
pushed a commit
to astral-sh/uv-dev
that referenced
this pull request
Oct 10, 2026
Add `--require-build-hashes` to require an exact version or direct URL and a trusted hash for every build dependency, including transitive dependencies. This builds on the supplied-hash verification in astral-sh#21467, which still allows dependencies without hashes. The requirement applies to builds run by project, build, tool, and pip commands, including builds needed to resolve metadata during locking or compilation. Hashes can come from `tool.uv.build-constraint-dependencies`, a `--build-constraint` file, or URL fragments in `build-system.requires`. Dependencies discovered through backend hooks or package metadata still need hashes declared upfront; hashes supplied only by those hooks or metadata do not satisfy the requirement. Enable the setting with `require-build-hashes = true` or the shared `UV_REQUIRE_BUILD_HASHES` environment variable. Pip commands can override the top-level setting in `[tool.uv.pip]`. CLI flags take precedence over the environment, which takes precedence over configuration. `--no-require-build-hashes` turns off the requirement without disabling verification of supplied hashes. This complements `--require-hashes` for runtime dependencies. The existing `uv build --require-hashes` behavior for command-line build constraints is unchanged. Requiring build hashes needs build isolation, except when uv uses its bundled `uv_build` backend, which is part of the executable. It does not retroactively verify installed packages or previously built wheels. The option is experimental and warns unless `--preview-features build-dependency-hashes` is enabled. Stacked on astral-sh#21708. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
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.
uv can use the bundled
uv_buildbackend even when a hashed build constraint pins a different version. Fall back to an external PEP 517 build when an active, exact pin with supplied hashes selects another version.--no-verify-hashesbypasses this behavior.Stacked on #21467.