diff --git a/README.md b/README.md index 4ffb8687f..aecf1306a 100644 --- a/README.md +++ b/README.md @@ -504,6 +504,8 @@ uv accepts the following command-line arguments as environment variables: uv will require that all dependencies have a hash specified in the requirements file. - `UV_CONSTRAINT`: Equivalent to the `--constraint` command-line argument. If set, uv will use this file as the constraints file. Uses space-separated list of files. +- `UV_LINK_MODE`: Equivalent to the `--link-mode` command-line argument. If set, uv will use this + as a link mode. In each case, the corresponding command-line argument takes precedence over an environment variable. diff --git a/crates/uv/src/cli.rs b/crates/uv/src/cli.rs index e9df8fdc4..42d92003f 100644 --- a/crates/uv/src/cli.rs +++ b/crates/uv/src/cli.rs @@ -383,7 +383,7 @@ pub(crate) struct PipCompileArgs { /// /// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and /// Windows. - #[arg(long, value_enum)] + #[arg(long, value_enum, env = "UV_LINK_MODE")] pub(crate) link_mode: Option, /// The URL of the Python package index (by default: ). @@ -644,7 +644,7 @@ pub(crate) struct PipSyncArgs { /// /// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and /// Windows. - #[arg(long, value_enum)] + #[arg(long, value_enum, env = "UV_LINK_MODE")] pub(crate) link_mode: Option, /// The URL of the Python package index (by default: ). @@ -995,7 +995,7 @@ pub(crate) struct PipInstallArgs { /// /// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and /// Windows. - #[arg(long, value_enum)] + #[arg(long, value_enum, env = "UV_LINK_MODE")] pub(crate) link_mode: Option, /// The strategy to use when selecting between the different compatible versions for a given @@ -1641,7 +1641,7 @@ pub(crate) struct VenvArgs { /// /// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and /// Windows. - #[arg(long, value_enum)] + #[arg(long, value_enum, env = "UV_LINK_MODE")] pub(crate) link_mode: Option, /// The URL of the Python package index (by default: ).