diff --git a/README.md b/README.md index 8af5d204b..200603e50 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,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_OVERRIDE`: Equivalent to the `--override` command-line argument. If set, uv will use this + file as the overrides 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. - `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set, diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 39ce9a134..5ff66e44e 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -373,8 +373,8 @@ pub struct PipCompileArgs { /// While constraints are _additive_, in that they're combined with the requirements of the /// constituent packages, overrides are _absolute_, in that they completely replace the /// requirements of the constituent packages. - #[arg(long, value_parser = parse_file_path)] - pub r#override: Vec, + #[arg(long, env = "UV_OVERRIDE", value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub r#override: Vec>, /// Include optional dependencies from the extra group name; may be provided more than once. /// Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources. @@ -906,8 +906,8 @@ pub struct PipInstallArgs { /// While constraints are _additive_, in that they're combined with the requirements of the /// constituent packages, overrides are _absolute_, in that they completely replace the /// requirements of the constituent packages. - #[arg(long, value_parser = parse_file_path)] - pub r#override: Vec, + #[arg(long, env = "UV_OVERRIDE", value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub r#override: Vec>, /// Include optional dependencies from the extra group name; may be provided more than once. /// Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources. diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 1b38d2859..50ea61617 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -684,7 +684,10 @@ impl PipCompileSettings { .into_iter() .filter_map(Maybe::into_option) .collect(), - r#override, + r#override: r#override + .into_iter() + .filter_map(Maybe::into_option) + .collect(), overrides_from_workspace, refresh: Refresh::from(refresh), settings: PipSettings::combine( @@ -890,7 +893,10 @@ impl PipInstallSettings { .into_iter() .filter_map(Maybe::into_option) .collect(), - r#override, + r#override: r#override + .into_iter() + .filter_map(Maybe::into_option) + .collect(), dry_run, overrides_from_workspace, refresh: Refresh::from(refresh),