Add UV_RESOLUTION environment variable for --resolution (#2720)

Closes https://github.com/astral-sh/uv/issues/2710.
This commit is contained in:
Charlie Marsh 2024-03-28 17:08:16 -04:00 committed by GitHub
parent 27b96211a2
commit ce5df77ecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -439,8 +439,10 @@ uv accepts the following command-line arguments as environment variables:
directory for caching instead of the default cache directory.
- `UV_NO_CACHE`: Equivalent to the `--no-cache` command-line argument. If set, uv will not use the
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_RESOLUTION`: Equivalent to the `--resolution` command-line argument. For example, if set to
`lowest-direct`, uv will install the lowest compatible versions of all direct dependencies.
- `UV_PRERELEASE`: Equivalent to the `--prerelease` command-line argument. For example, 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_PYTHON=true` is intended for use in continuous integration (CI) environments and

View file

@ -306,7 +306,7 @@ struct PipCompileArgs {
#[clap(long)]
no_deps: bool,
#[clap(long, value_enum, default_value_t = ResolutionMode::default())]
#[clap(long, value_enum, default_value_t = ResolutionMode::default(), env = "UV_RESOLUTION")]
resolution: ResolutionMode,
#[clap(long, value_enum, default_value_t = PreReleaseMode::default(), conflicts_with = "pre", env = "UV_PRERELEASE")]
@ -781,7 +781,7 @@ struct PipInstallArgs {
#[clap(long, value_enum, default_value_t = install_wheel_rs::linker::LinkMode::default())]
link_mode: install_wheel_rs::linker::LinkMode,
#[clap(long, value_enum, default_value_t = ResolutionMode::default())]
#[clap(long, value_enum, default_value_t = ResolutionMode::default(), env = "UV_RESOLUTION")]
resolution: ResolutionMode,
#[clap(long, value_enum, default_value_t = PreReleaseMode::default(), conflicts_with = "pre", env = "UV_PRERELEASE")]