Repository navigation
chore: validate uv.lock matches pyproject.toml - #432
Merged
Merged
Conversation
NicoleMGomes
approved these changes
Oct 28, 2026
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.
Description
Adds a guardrail that fails whenever
uv.lockis out of date withpyproject.toml, closing a lockfile-drift gap.Recently a batch dependabot bump (#415) changed
pyproject.tomlwithout updatinguv.lock. Nothing in CI caught it: thechecks.yamljob runsuv sync --all-extras, which silently regenerates the lock in the runner instead of failing on stale state. Because dependabot patch/minor PRs auto-merge, a drifted lock can reachmainwith no human in the loop.This PR adds the check in two places:
.github/workflows/checks.yaml): auv lock --checkstep placed beforeuv sync, sosynccannot mask the drift. Runs on every PR and push tomain, and since dependabot PRs also trigger this workflow, it covers the auto-merge path..pre-commit-config.yaml): auv-lock-checklocal hook scoped viafiles:topyproject.toml/uv.lockchanges, giving contributors fast local feedback without slowing down ordinary code commits.Type of Change
How to Test
pyproject.tomlbut do not re-lock.uv lock --checklocally (or push and watch the "Verify uv.lock is up to date" CI step), it should fail.uv lock, commit the updateduv.lock, and confirm both the local check and CI step pass.Pre-commit hook scoping can be verified directly with
uvx pre-commit run uv-lock-check --all-files(passes), and it is skipped on commits that touch neitherpyproject.tomlnoruv.lock.Checklist
Additional Notes
The drift from #415 was already reconciled on
main, souv lock --checkpasses on the current tip. This PR only installs the guardrail; no lockfile reconcile commit is included.