Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UV_NO_SYNC environment variable #7752

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ pub struct RunArgs {
///
/// 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")]
#[arg(long, env = "UV_NO_SYNC", value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "frozen")]
pub no_sync: bool,

/// Assert that the `uv.lock` will remain unchanged.
Expand Down Expand Up @@ -2844,7 +2844,7 @@ pub struct AddArgs {
pub extra: Option<Vec<ExtraName>>,

/// Avoid syncing the virtual environment.
#[arg(long, conflicts_with = "frozen")]
#[arg(long, env = "UV_NO_SYNC", value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "frozen")]
pub no_sync: bool,

/// Assert that the `uv.lock` will remain unchanged.
Expand Down Expand Up @@ -2913,7 +2913,7 @@ pub struct RemoveArgs {
pub optional: Option<ExtraName>,

/// Avoid syncing the virtual environment after re-locking the project.
#[arg(long, conflicts_with = "frozen")]
#[arg(long, env = "UV_NO_SYNC", value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "frozen")]
pub no_sync: bool,

/// Assert that the `uv.lock` will remain unchanged.
Expand Down
2 changes: 2 additions & 0 deletions docs/configuration/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ uv accepts the following command-line arguments as environment variables:
set, uv will use this username for publishing.
- `UV_PUBLISH_PASSWORD`: Equivalent to the `--password` command-line argument in `uv publish`. If
set, uv will use this password for publishing.
- `UV_NO_SYNC`: Equivalent to the `--no-sync` command-line argument. If set, uv will skip updating
the environment.

In each case, the corresponding command-line argument takes precedence over an environment variable.

Expand Down
3 changes: 3 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ uv run [OPTIONS] <COMMAND>

<p>Implies <code>--frozen</code>, as the project dependencies will be ignored (i.e., the lockfile will not be updated, since the environment will not be synced regardless).</p>

<p>May also be set with the <code>UV_NO_SYNC</code> environment variable.</p>
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>

<p>When disabled, uv will only use locally cached data and locally available files.</p>
Expand Down Expand Up @@ -792,6 +793,7 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>

</dd><dt><code>--no-sync</code></dt><dd><p>Avoid syncing the virtual environment</p>

<p>May also be set with the <code>UV_NO_SYNC</code> environment variable.</p>
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>

<p>When disabled, uv will only use locally cached data and locally available files.</p>
Expand Down Expand Up @@ -1108,6 +1110,7 @@ uv remove [OPTIONS] <PACKAGES>...

</dd><dt><code>--no-sync</code></dt><dd><p>Avoid syncing the virtual environment after re-locking the project</p>

<p>May also be set with the <code>UV_NO_SYNC</code> environment variable.</p>
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>

<p>When disabled, uv will only use locally cached data and locally available files.</p>
Expand Down
Loading