build: migrate uv.lock to revision 2 - #555
Merged
Merged
Conversation
The committed lockfile is at `revision = 1`, a format any current uv upgrades to `revision = 2` (adding `upload-time` metadata per artifact) the moment it has to write the file. `uv lock` is a no-op while nothing changed, so the migration stays invisible until something forces a write — and a release bump always does, since `bump_version.py` runs `uv lock` after rewriting the version. That put an unrelated ~1900-line format change inside the next release commit, whoever cut it. Doing it deliberately here instead, decoupled from any version bump. The diff is purely the format: stripping the added `upload-time` fields and the revision line makes the new lockfile byte-identical to the old one, so no dependency resolution moved. `uv sync --locked` passes, as does `bump_version.py verify`. Produced by bumping the version away and straight back, which forces uv to rewrite the lockfile while leaving every other version-bearing file untouched.
adriannoes
self-requested a review
July 31, 2026 19:06
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.
Motivation
uv.lockis committed atrevision = 1. Any current uv upgrades it torevision = 2— adding anupload-timefield per artifact — the moment it has to write the file. That never surfaces during normal work becauseuv lockis a no-op while nothing has changed, but a release bump always forces a write:bump_version.pyrunsuv lockright after rewriting the version. So the next release commit, whoever cut it, would have carried an unrelated ~1900-line format migration alongside the version bump.This came up while reviewing #554, where exactly that happened by accident.
Outcome
The migration lands on its own, decoupled from any version bump, so the next release commit is only a version bump.
The change is purely the format: stripping the added
upload-timefields and the revision line makes the new lockfile byte-identical to the old one, so no dependency resolution moved and no package version changed.uv sync --lockedexits 0,bump_version.py verifypasses, and the suite is green.It was produced by bumping the workspace version away and straight back, which forces uv to rewrite the lockfile while leaving every other version-bearing file untouched — hence the single-file diff.
Notes
Worth considering as a follow-up: the repo pins no uv version (
setup-uv@v7with no version, no[tool.uv] required-version), which is why the committed lockfile could drift behind contributors' local uv in the first place. Arequired-versionpin would keep this from recurring, but it needs agreement on a version and would block anyone on an older uv, so it is not folded in here.