astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
19.84k stars 582 forks source link

[Feature request] Explicit dry-run cli option #6408

Open birdhackor opened 3 weeks ago

birdhackor commented 3 weeks ago

If I want to know which packages versions will change when I do a upgradable relock, I might want to do the following command

$ uv lock -U --dry-run

Currently, there seems to be no direct instruction to achieve a similar effect. The following command will report an error and cannot achieve the effect I want.

$ uv lock -U --locked
Resolved 10 packages in 126ms
error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`.
charliermarsh commented 3 weeks ago

This makes sense to me.

zanieb commented 3 weeks ago

Makes sense. There's also uv lock -U && git diff && git reset --hard, but we can do better.