Repository navigation
Bound uv required-version so Renovate stops silently changing the lockfile format - #243
rhysyngsun wants to merge 1 commit into
Conversation
Renovate chooses which uv binary to run by resolving `[tool.uv].required-version`. Left open-ended, that resolves to whatever uv its runner happens to ship, so a routine dependency bump can rewrite `uv.lock` in a newer format with nothing in the PR title or diff summary to say so. Anyone on an older uv who then runs `uv lock` reverts the format and drops fields, and both `uv lock --check` and `uv sync --locked` pass against the result. An upper bound makes a lockfile format change something a person chooses rather than something a bot's runner decides. This repo's lockfile is `revision = 3`, written by uv 0.9.17 through 0.12.21. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZvmEumrfZcNJ8DcaT5gEg
There was a problem hiding this comment.
Summary
Bounds uv versions to keep Renovate on the current lockfile format.
Dependencies changed: pyproject.toml
Summary of dd88e56 · React 👍 or 👎 on my comments to tune what I raise · Commands · Review config
|
Closing: the uv has only ever changed the Replaced by a check that asserts the lockfile revision directly: mitodl/ol-github-workflows#18. It is version-number independent, catches downgrades as well as upgrades, fails on the pull request, and cannot break a build. A follow-up PR will add it here. Full reasoning and evidence: https://github.com/mitodl/hq/issues/14344#issuecomment-6855508426 |
Sets
[tool.uv].required-versionto>=0.9.17,<0.12.22— the range of uv versions that writeuv.lockrevision = 3, which is the revision this repo is on.Why
Renovate reads
[tool.uv].required-versionand uses it to pick which uv binary to run (pep621/processors/uv.ts). With no upper bound it resolves to the newest uv available on the runner, so a dependency bump can move the lockfile to a newer format as a side effect — no mention of it in the title, no package entries changed.That happened in mit-learn#4070: one line of
pyproject.toml, zero package changes, anduv.lockmoved fromrevision = 3torevision = 5. Anyone on an older uv who runsuv lockafterwards silently reverts it, and the existing gates cannot see it:uv lock --checkuv sync --lockedA newer uv accepts an older-revision lockfile as valid, so only reading the
uv.lockdiff catches the regression.Renovate never writes
required-version, so it will not propose raising this bound itself. Moving to a new lockfile format becomes a deliberate, reviewable change.Verification
uv.lockis untouched — this PR changespyproject.tomlonly. If a lockfile moves, the constraint is wrong.>=0.9.17,<0.12.22.Part of mitodl/hq#14344