ci: the lockfile's copy of the version is checked too - #118
Merged
Merged
Conversation
The lint step's own comment says why the version is checked: declared in two places, `pip show` and `import` disagree if they drift. There is a third copy -- `uv.lock` carries an entry for this project -- and it drifted. 0.1.6 and 0.1.7 both shipped with a lockfile saying 0.1.5, because nothing re-locked after the bump and nothing looked. `uv lock` fixes the stale line. The guard is what stops the next one: the step now parses uv.lock too and refuses a mismatch, naming `uv lock` as the remedy. It also refuses anything other than exactly one entry for grapharc, so a rename cannot make the check silently vacuous. Milder than the other two copies -- it misreports the project to a reader of the lockfile and to `uv sync --locked`, not to an installed import -- but it is the same class of bug, and a version declared in N places drifts in N-1 of them. Verified: the new check passes on this tree and is red against main's lockfile (says 0.1.5, pyproject says 0.1.7), which is the drift it exists to catch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
The drift
ci.yml's lint step checks thatpyproject.tomlandgrapharc.__version__agree, and its comment says why: if they drift,pip showandimportdisagree about what is installed.There is a third copy.
uv.lockcarries an entry for this project, and it drifted:Both 0.1.6 and 0.1.7 shipped that way — nothing re-locked after the version bump, and no job looked.
The fix
uv lockcorrects the stale line (one line, in this PR). The guard is the part that matters: the lint step now parsesuv.lockas well and refuses a mismatch, naminguv lockas the remedy. It also refuses anything other than exactly onegrapharcentry, so a rename cannot make the check silently vacuous instead of failing.Severity, honestly
Milder than the other two copies. A stale version in the lockfile misreports the project to someone reading the lockfile and to
uv sync --locked; it does not reach an installed import the way a bad__version__would. But it is the same class of bug as the one that step already guards, and a version declared in N places drifts in N−1 of them.Verification
main's lockfile — "uv.lock says '0.1.5' but pyproject says '0.1.7'" — which is the drift it exists to catch.ci.ymlstill parses.Touches a different region of
ci.ymlthan #116, so the two merge independently.🤖 Generated with Claude Code