fix: uv sync --locked validates against pyproject.toml (--frozen does not) #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/dockerfile-uv-locked"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
uv sync --frozendoes not validateuv.lockagainstpyproject.toml. It only means "don't re-lock" — it installs whatever the lockfile already says, even ifpyproject.tomlhas moved on. The flag that asserts the lock is up to date is--locked.Combined with
2>/dev/null, a stale lockfile produced a silently wrong image: old dependencies installed, no error surfaced, no way to tell from the build log which branch of the||ran.Fix
--lockedfails the command whenuv.lockdisagrees withpyproject.toml.2>/dev/nullremoved, so when it fails the reason is in the build log.|| uv sync --no-devfallback is kept for the no-lockfile case.Caveat on the fallback
The fallback means a stale lock is now visible but still not fatal — the build prints the error and then resolves dependencies fresh. That is a deliberate compromise to avoid breaking builds in repos without a committed lockfile. If we want stale locks to hard-fail, the fallback has to go, which is a separate decision.
Verification
uv lock --checkrun locally against this repo before the change.Fleet-wide change: 7 Dockerfiles across 6 repos (smeos x2, haskos-engineering, haskos-sales, haskos-pm, haskos-legal, haskos-finance).