Use uv sync --locked instead of --frozen in CI - #62
Merged
Merged
Conversation
Both install exactly what uv.lock says and neither modifies it. The difference is that --locked first verifies the lock is consistent with pyproject.toml, while --frozen skips that check entirely. That gap is reachable today: editing a dependency in pyproject.toml without running `uv lock` leaves CI installing the stale lock and passing green, with the declared and installed dependency sets silently disagreeing. Confirmed by adding an unlocked dependency -- --frozen succeeds, --locked fails as it should. Nothing else changes. Resolution stays pinned, so CI failures remain attributable to the change under test rather than to upstream releases.
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.
A one-word change per workflow that closes a real gap.
Both flags install exactly what
uv.locksays, and neither modifies it. The difference:--frozen— sync without updating the lock, skipping any consistency check--locked— assert the lock is consistent withpyproject.toml, then syncSo
--frozenwill happily install a lock that no longer matches the declared dependencies.This is reachable today
Editing a dependency in
pyproject.tomlwithout runninguv lockleaves CI installing the stale lock and passing green, with the declared and installed dependency sets silently disagreeing. There is no separateuv lock --checkstep in any workflow to catch it either.Confirmed by adding an unlocked dependency to
pyproject.toml:What does not change
Resolution stays pinned to the lockfile, so CI failures remain attributable to the change under test rather than to whatever upstream published overnight. That determinism is the reason to keep a lockfile in CI at all, and this preserves it.
Applied to all four workflows that sync:
pytest.yml,lint.yml,docs.yml,deploy-gh-pages.yml.Testing against fresh resolutions — what users actually get, rather than what the dev lockfile pins — is worth doing too, but belongs in a separate scheduled job rather than in the per-PR matrix, so that an upstream break cannot block merges. That is a follow-up.