mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
Env variables for python downloads (#6416)
## Summary Resolves #6406 ## Test Plan ``` ❯ UV_PYTHON_PREFERENCE=only-managed cargo run -q -- sync --show-settings | rg python_preference python_preference: OnlyManaged, ❯ UV_PYTHON_PREFERENCE=system cargo run -q -- sync --show-settings | rg python_preference python_preference: System, ❯ UV_NO_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads python_downloads: Never, ❯ UV_ALLOW_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads python_downloads: Automatic, ```
This commit is contained in:
parent
a3a5b82a17
commit
bbd9adaa40
3 changed files with 50 additions and 24 deletions
|
@ -115,16 +115,30 @@ pub struct GlobalArgs {
|
|||
global = true,
|
||||
long,
|
||||
help_heading = "Python options",
|
||||
display_order = 700
|
||||
display_order = 700,
|
||||
env = "UV_PYTHON_PREFERENCE"
|
||||
)]
|
||||
pub python_preference: Option<PythonPreference>,
|
||||
|
||||
/// Allow automatically downloading Python when required.
|
||||
#[arg(global = true, long, help_heading = "Python options", hide = true)]
|
||||
#[arg(
|
||||
global = true,
|
||||
long,
|
||||
help_heading = "Python options",
|
||||
hide = true,
|
||||
value_parser = clap::builder::BoolishValueParser::new(),
|
||||
env = "UV_ALLOW_PYTHON_DOWNLOADS"
|
||||
)]
|
||||
pub allow_python_downloads: bool,
|
||||
|
||||
/// Disable automatic downloads of Python.
|
||||
#[arg(global = true, long, help_heading = "Python options")]
|
||||
#[arg(
|
||||
global = true,
|
||||
long,
|
||||
help_heading = "Python options",
|
||||
value_parser = clap::builder::BoolishValueParser::new(),
|
||||
env = "UV_NO_PYTHON_DOWNLOADS"
|
||||
)]
|
||||
pub no_python_downloads: bool,
|
||||
|
||||
/// Deprecated version of [`Self::python_downloads`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue