Skip to content

Use uv sync --locked instead of --frozen in CI - #62

Merged
xhan97 merged 1 commit into
mainfrom
chore/ci-locked-not-frozen
Aug 15, 2026
Merged

xhan97 merged 1 commit into
mainfrom
chore/ci-locked-not-frozen

Conversation

@xhan97

@xhan97 xhan97 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

A one-word change per workflow that closes a real gap.

Both flags install exactly what uv.lock says, and neither modifies it. The difference:

  • --frozen — sync without updating the lock, skipping any consistency check
  • --locked — assert the lock is consistent with pyproject.toml, then sync

So --frozen will happily install a lock that no longer matches the declared dependencies.

This 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. There is no separate uv lock --check step in any workflow to catch it either.

Confirmed by adding an unlocked dependency to pyproject.toml:

uv sync --frozen : passes  ← the gap
uv sync --locked : fails   ← correct

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.

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.
@xhan97
xhan97 merged commit 549618b into main Aug 15, 2026
16 checks passed
@xhan97
xhan97 deleted the chore/ci-locked-not-frozen branch August 15, 2026 17:33
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