astral-sh/uv

Show a better error when a uv lockfile is used in `-r`

Open

#16,192 opened on Oct 8, 2025

View on GitHub
 (3 comments) (4 reactions) (0 assignees)Rust (3,111 forks)batch import
error messageshelp wanted

Repository metrics

Stars
 (84,934 stars)
PR merge metrics
 (Avg merge 6d 16h) (222 merged PRs in 30d)

Description

e.g., if you try to use uv lock --script action.py then -r action.py.lock

error: Couldn't parse requirement in `action.py.lock` at position 0
  Caused by: no such comparison operator "=", must be one of ~= == != <= >= < > ===
version = 1
        ^^^

We can do better by detecting our own lockfile format

Contributor guide