Skip to content

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

Closed

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.

Activity

  1. added a commit that references this issue on Mar 18, 2026
    bccd759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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