Add uv run --no-sync (#7192)

## Summary

When `--no-sync` is provided, we won't lock or sync, but we will run the
command in the project environment.

Closes https://github.com/astral-sh/uv/issues/7165.
This commit is contained in:
Charlie Marsh 2024-09-10 17:29:43 -04:00 committed by GitHub
parent 4b7fed84eb
commit 3f011f3b7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 142 additions and 56 deletions

View file

@ -2434,6 +2434,13 @@ pub struct RunArgs {
#[arg(long)]
pub isolated: bool,
/// Avoid syncing the virtual environment.
///
/// Implies `--frozen`, as the project dependencies will be ignored (i.e., the lockfile will not
/// be updated, since the environment will not be synced regardless).
#[arg(long, conflicts_with = "frozen")]
pub no_sync: bool,
/// Assert that the `uv.lock` will remain unchanged.
///
/// Requires that the lockfile is up-to-date. If the lockfile is missing or
@ -2735,7 +2742,7 @@ pub struct AddArgs {
#[arg(long)]
pub extra: Option<Vec<ExtraName>>,
/// Avoid syncing the virtual environment after re-locking the project.
/// Avoid syncing the virtual environment.
#[arg(long, conflicts_with = "frozen")]
pub no_sync: bool,