Skip to content
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ uv accepts the following command-line arguments as environment variables:
cache for any operations.
- `UV_PRERELEASE`: Equivalent to the `--prerelease` command-line argument. If set to `allow`, uv
will allow pre-release versions for all dependencies.
- `UV_SYSTEM_PYTHON`: Equivalent to the `--system` command-line argument. If set to `true`, uv
will use the first Python interpreter found in the system `PATH`.
WARNING: `UV_SYSTEM=true` is intended for use in continuous integration (CI) environments and
should be used with caution, as it can modify the system Python installation.

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

Expand Down
49 changes: 42 additions & 7 deletions crates/uv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,12 @@ struct PipSyncArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution, as it can modify the system Python installation.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,

/// Allow `uv` to modify an `EXTERNALLY-MANAGED` Python installation.
Expand Down Expand Up @@ -788,7 +793,12 @@ struct PipInstallArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution, as it can modify the system Python installation.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,

/// Allow `uv` to modify an `EXTERNALLY-MANAGED` Python installation.
Expand Down Expand Up @@ -916,7 +926,12 @@ struct PipUninstallArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution, as it can modify the system Python installation.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,

/// Allow `uv` to modify an `EXTERNALLY-MANAGED` Python installation.
Expand Down Expand Up @@ -970,7 +985,12 @@ struct PipFreezeArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,
}

Expand Down Expand Up @@ -1027,7 +1047,12 @@ struct PipListArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,
}

Expand Down Expand Up @@ -1071,7 +1096,12 @@ struct PipShowArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,
}

Expand Down Expand Up @@ -1105,7 +1135,12 @@ struct VenvArgs {
///
/// WARNING: `--system` is intended for use in continuous integration (CI) environments and
/// should be used with caution, as it can modify the system Python installation.
#[clap(long, conflicts_with = "python", group = "discovery")]
#[clap(
long,
conflicts_with = "python",
env = "UV_SYSTEM_PYTHON",
group = "discovery"
)]
system: bool,

/// Install seed packages (`pip`, `setuptools`, and `wheel`) into the virtual environment.
Expand Down