Add uv sync --dry-run (#11299)

## Summary

Allows users to understand how the environment will change prior to
committing.

Closes https://github.com/astral-sh/uv/issues/11282.
This commit is contained in:
Charlie Marsh 2025-02-06 18:52:49 -05:00 committed by GitHub
parent 67e2f904ed
commit 8335a6d816
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 397 additions and 129 deletions

View file

@ -3091,6 +3091,13 @@ pub struct SyncArgs {
#[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")]
pub frozen: bool,
/// Perform a dry run, without writing the lockfile or modifying the project environment.
///
/// In dry-run mode, uv will resolve the project's dependencies and report on the resulting
/// changes to both the lockfile and the project environment, but will not modify either.
#[arg(long, conflicts_with = "locked", conflicts_with = "frozen")]
pub dry_run: bool,
#[command(flatten)]
pub installer: ResolverInstallerArgs,