Skip to content

Pin the build backend to hashes - #74

Merged
marcleblanc2 merged 1 commit into
mainfrom
marc/hash-pinned-build
Nov 12, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
marc/hash-pinned-build

Conversation

@marcleblanc2

Copy link
Copy Markdown
Collaborator

uv build resolved hatchling and hatch-vcs fresh from PyPI on every CI and release run, so the code that builds the published wheel was unpinned and unverified.

  • build-requirements.txt pins both, and everything they install, to exact versions and sha256 hashes.
  • CI and release builds pass it with --build-constraints build-requirements.txt --require-hashes. A build requirement that is missing from the file, or whose hash differs, fails the build.
  • Renovate's pip_requirements manager picks the file up by name and updates versions and hashes. A package rule groups those updates into one pull request.
  • A change to build-requirements.txt now triggers the package build job.

Test plan

Ran the CI build step locally under uv 0.11.7 and uv 0.13.4 with an empty cache; both built the wheel and source distribution.

With an empty cache, a changed hatchling hash failed with Hash mismatch for hatchling==1.33.0, and removing the pathspec pin failed with In --require-hashes mode, all requirements must be pinned upfront.

The release workflow uses the same flags but only runs on a tag, so it is untested until the next release.

uv build now takes its build requirements from build-requirements.txt
with --require-hashes, so CI and release builds fail on any build
requirement that is unpinned or whose hash differs. Renovate updates
the pins as one grouped pull request.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ca38-20a5-7436-a7ae-1f2bce712489
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 merged commit c113421 into main Nov 12, 2026
7 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/hash-pinned-build branch November 12, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant