Skip to content

uv lock --check --refresh false positive in workspace with [tool.uv.conflicts] #18553

@kingjin94

Description

@kingjin94

`uv lock --check --refresh` reports "lockfile needs to be updated" (exit 1) even when `uv lock --refresh` produces a byte-for-byte identical lockfile. This is a false positive — confirmed by running `git diff uv.lock` immediately after, which shows zero changes.

Minimal reproducible example

https://github.com/kingjin94/workspace-conflicts/tree/repro/uv-check-refresh-false-positive

A workspace with 4 packages each declaring conflicting prod/non-prod extras (`psycopg2` vs `psycopg2-binary`) via `[tool.uv.conflicts]`.

git clone https://github.com/kingjin94/workspace-conflicts
cd workspace-conflicts
git checkout repro/uv-check-refresh-false-positive
bash repro-check-refresh.sh

Full output:

=== Step 1: uv lock --refresh (writes result) ===
Resolved 7 packages in 170ms
Exit code: 0

=== Step 2: git diff uv.lock (should be empty) ===
No changes — lockfile is up to date

=== Step 3: uv lock --check --refresh (should also pass, but fails) ===
Resolved 7 packages in 151ms
The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`.
Exit code: 1

Steps 1 and 2 prove the lockfile is genuinely current. Step 3 is a false positive.

Notes

The workspace uses `[tool.uv.conflicts]` to declare prod/non-prod extras as incompatible. This generates conflict fork markers in the lockfile. The `--check` validation pass appears to apply different marker normalization than the write pass, causing a structural mismatch even when the lockfile content is semantically identical.

This is a distinct surviving variant after the fixes in:

Confirmed still present on 0.10.11 with a workspace using `[tool.uv.conflicts]` + extras.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions