Skip to content

ci: the lockfile's copy of the version is checked too - #118

Merged
Shashankss1205 merged 1 commit into
mainfrom
fix/lockfile-version-drift
Sep 25, 2026
Merged

Shashankss1205 merged 1 commit into
mainfrom
fix/lockfile-version-drift

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

The drift

ci.yml's lint step checks that pyproject.toml and grapharc.__version__ agree, and its comment says why: if they drift, pip show and import disagree about what is installed.

There is a third copy. uv.lock carries an entry for this project, and it drifted:

[[package]]
name = "grapharc"
version = "0.1.5"     # pyproject.toml and __init__.py both say 0.1.7

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 lock corrects the stale line (one line, in this PR). The guard is the part that matters: the lint step now parses uv.lock as well and refuses a mismatch, naming uv lock as the remedy. It also refuses anything other than exactly one grapharc entry, 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

  • The new check passes on this tree.
  • It is red against main's lockfile — "uv.lock says '0.1.5' but pyproject says '0.1.7'" — which is the drift it exists to catch.
  • ci.yml still parses.

Touches a different region of ci.yml than #116, so the two merge independently.

🤖 Generated with Claude Code

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>
@Shashankss1205
Shashankss1205 merged commit 92a12ed into main Sep 25, 2026
6 checks passed
@Shashankss1205
Shashankss1205 deleted the fix/lockfile-version-drift branch September 25, 2026 19:35
@Shashankss1205 Shashankss1205 mentioned this pull request Sep 26, 2026
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