mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Update the interface for declaring Python download preferences (#5936)
The loose consensus is that "fetch" doesn't have much meaning and that a boolean flag makes more sense from the command line. 1. Adds `--allow-python-downloads` (hidden, default) and `--no-python-downloads` to the CLI to quickly enable or disable downloads 2. Deprecates `--python-fetch` in favor of the options from (1) 3. Removes `python-fetch` in favor of a `python-downloads` setting 5. Adds a `never` variant to the enum, allowing even explicit installs to be disabled via the configuration file ## Test plan I tested this with various `pyproject.toml`-level settings and `uv venv --preview --python 3.12.2` and `uv python install 3.12.2` with and without the new CLI flags.
This commit is contained in:
parent
a129cf7d7e
commit
4df0fe9a01
28 changed files with 266 additions and 488 deletions
|
@ -15,7 +15,7 @@ use uv_configuration::{
|
|||
ConfigSettingEntry, IndexStrategy, KeyringProviderType, PackageNameSpecifier, TargetTriple,
|
||||
};
|
||||
use uv_normalize::{ExtraName, PackageName};
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonVersion};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, PrereleaseMode, ResolutionMode};
|
||||
|
||||
pub mod compat;
|
||||
|
@ -119,9 +119,17 @@ pub struct GlobalArgs {
|
|||
)]
|
||||
pub python_preference: Option<PythonPreference>,
|
||||
|
||||
/// Whether to automatically download Python when required.
|
||||
/// Allow automatically downloading Python when required.
|
||||
#[arg(global = true, long, help_heading = "Python options", hide = true)]
|
||||
pub allow_python_downloads: bool,
|
||||
|
||||
/// Disable automatic downloads of Python.
|
||||
#[arg(global = true, long, help_heading = "Python options")]
|
||||
pub python_fetch: Option<PythonFetch>,
|
||||
pub no_python_downloads: bool,
|
||||
|
||||
/// Deprecated version of [`Self::python_downloads`].
|
||||
#[arg(global = true, long, hide = true)]
|
||||
pub python_fetch: Option<PythonDownloads>,
|
||||
|
||||
/// Do not print any output.
|
||||
#[arg(global = true, long, short, conflicts_with = "verbose")]
|
||||
|
@ -258,7 +266,7 @@ pub enum Commands {
|
|||
///
|
||||
/// When preview is enabled, i.e., via `--preview` or by using a preview
|
||||
/// command, uv will download Python if a version cannot be found. This
|
||||
/// behavior can be disabled with the `--python-fetch` option.
|
||||
/// behavior can be disabled with the `--python-downloads` option.
|
||||
///
|
||||
/// The `--python` option allows requesting a different interpreter.
|
||||
///
|
||||
|
|
|
@ -79,12 +79,25 @@ pub enum PythonPreference {
|
|||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub enum PythonFetch {
|
||||
/// Automatically fetch managed Python installations when needed.
|
||||
pub enum PythonDownloads {
|
||||
/// Automatically download managed Python installations when needed.
|
||||
#[default]
|
||||
#[serde(alias = "auto")]
|
||||
Automatic,
|
||||
/// Do not automatically fetch managed Python installations; require explicit installation.
|
||||
/// Do not automatically download managed Python installations; require explicit installation.
|
||||
Manual,
|
||||
/// Do not ever allow Python downloads.
|
||||
Never,
|
||||
}
|
||||
|
||||
impl From<bool> for PythonDownloads {
|
||||
fn from(value: bool) -> Self {
|
||||
if value {
|
||||
PythonDownloads::Automatic
|
||||
} else {
|
||||
PythonDownloads::Never
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
|
@ -1298,7 +1311,7 @@ impl PythonPreference {
|
|||
}
|
||||
}
|
||||
|
||||
impl PythonFetch {
|
||||
impl PythonDownloads {
|
||||
pub fn is_automatic(self) -> bool {
|
||||
matches!(self, Self::Automatic)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ use crate::implementation::LenientImplementationName;
|
|||
use crate::managed::{ManagedPythonInstallation, ManagedPythonInstallations};
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
use crate::{
|
||||
downloads, Error, Interpreter, PythonFetch, PythonPreference, PythonSource, PythonVersion,
|
||||
downloads, Error, Interpreter, PythonDownloads, PythonPreference, PythonSource, PythonVersion,
|
||||
};
|
||||
|
||||
/// A Python interpreter and accompanying tools.
|
||||
|
@ -77,11 +77,11 @@ impl PythonInstallation {
|
|||
/// Find or fetch a [`PythonInstallation`].
|
||||
///
|
||||
/// Unlike [`PythonInstallation::find`], if the required Python is not installed it will be installed automatically.
|
||||
pub async fn find_or_fetch<'a>(
|
||||
pub async fn find_or_download<'a>(
|
||||
request: Option<PythonRequest>,
|
||||
environments: EnvironmentPreference,
|
||||
preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
client_builder: &BaseClientBuilder<'a>,
|
||||
cache: &Cache,
|
||||
reporter: Option<&dyn Reporter>,
|
||||
|
@ -94,7 +94,7 @@ impl PythonInstallation {
|
|||
// If missing and allowed, perform a fetch
|
||||
Err(Error::MissingPython(err))
|
||||
if preference.allows_managed()
|
||||
&& python_fetch.is_automatic()
|
||||
&& python_downloads.is_automatic()
|
||||
&& client_builder.connectivity.is_online() =>
|
||||
{
|
||||
if let Some(request) = PythonDownloadRequest::from_request(&request) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
use thiserror::Error;
|
||||
|
||||
pub use crate::discovery::{
|
||||
find_python_installations, EnvironmentPreference, Error as DiscoveryError, PythonFetch,
|
||||
find_python_installations, EnvironmentPreference, Error as DiscoveryError, PythonDownloads,
|
||||
PythonNotFound, PythonPreference, PythonRequest, PythonSource, VersionRequest,
|
||||
};
|
||||
pub use crate::environment::PythonEnvironment;
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::path::PathBuf;
|
|||
use distribution_types::IndexUrl;
|
||||
use install_wheel_rs::linker::LinkMode;
|
||||
use uv_configuration::{ConfigSettings, IndexStrategy, KeyringProviderType, TargetTriple};
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonVersion};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, PrereleaseMode, ResolutionMode};
|
||||
|
||||
use crate::{FilesystemOptions, PipOptions};
|
||||
|
@ -70,7 +70,7 @@ impl_combine_or!(ResolutionMode);
|
|||
impl_combine_or!(String);
|
||||
impl_combine_or!(TargetTriple);
|
||||
impl_combine_or!(PythonPreference);
|
||||
impl_combine_or!(PythonFetch);
|
||||
impl_combine_or!(PythonDownloads);
|
||||
impl_combine_or!(bool);
|
||||
|
||||
impl<T> Combine for Option<Vec<T>> {
|
||||
|
|
|
@ -11,7 +11,7 @@ use uv_configuration::{
|
|||
};
|
||||
use uv_macros::{CombineOptions, OptionsMetadata};
|
||||
use uv_normalize::{ExtraName, PackageName};
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonVersion};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, PrereleaseMode, ResolutionMode};
|
||||
|
||||
/// A `pyproject.toml` with an (optional) `[tool.uv]` section.
|
||||
|
@ -143,16 +143,16 @@ pub struct GlobalOptions {
|
|||
possible_values = true
|
||||
)]
|
||||
pub python_preference: Option<PythonPreference>,
|
||||
/// Whether to automatically download Python when required.
|
||||
/// Whether to allow Python downloads.
|
||||
#[option(
|
||||
default = "\"automatic\"",
|
||||
value_type = "str",
|
||||
example = r#"
|
||||
python-fetch = "manual"
|
||||
python-downloads = "manual"
|
||||
"#,
|
||||
possible_values = true
|
||||
)]
|
||||
pub python_fetch: Option<PythonFetch>,
|
||||
pub python_downloads: Option<PythonDownloads>,
|
||||
}
|
||||
|
||||
/// Settings relevant to all installer operations.
|
||||
|
|
|
@ -15,7 +15,7 @@ use uv_dispatch::BuildDispatch;
|
|||
use uv_distribution::DistributionDatabase;
|
||||
use uv_fs::CWD;
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonRequest};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonRequest};
|
||||
use uv_requirements::{NamedRequirementsResolver, RequirementsSource, RequirementsSpecification};
|
||||
use uv_resolver::FlatIndex;
|
||||
use uv_types::{BuildIsolation, HashStrategy};
|
||||
|
@ -51,7 +51,7 @@ pub(crate) async fn add(
|
|||
python: Option<String>,
|
||||
settings: ResolverInstallerSettings,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
preview: PreviewMode,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
|
@ -93,7 +93,7 @@ pub(crate) async fn add(
|
|||
project.workspace(),
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -11,7 +11,7 @@ use uv_client::{BaseClientBuilder, Connectivity};
|
|||
use uv_configuration::PreviewMode;
|
||||
use uv_fs::{absolutize_path, Simplified, CWD};
|
||||
use uv_python::{
|
||||
EnvironmentPreference, PythonFetch, PythonInstallation, PythonPreference, PythonRequest,
|
||||
EnvironmentPreference, PythonDownloads, PythonInstallation, PythonPreference, PythonRequest,
|
||||
VersionRequest,
|
||||
};
|
||||
use uv_resolver::RequiresPython;
|
||||
|
@ -35,7 +35,7 @@ pub(crate) async fn init(
|
|||
no_workspace: bool,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
native_tls: bool,
|
||||
cache: &Cache,
|
||||
|
@ -86,7 +86,7 @@ pub(crate) async fn init(
|
|||
python,
|
||||
no_workspace,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
@ -160,7 +160,7 @@ async fn init_project(
|
|||
python: Option<String>,
|
||||
no_workspace: bool,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
native_tls: bool,
|
||||
cache: &Cache,
|
||||
|
@ -213,11 +213,11 @@ async fn init_project(
|
|||
let client_builder = BaseClientBuilder::new()
|
||||
.connectivity(connectivity)
|
||||
.native_tls(native_tls);
|
||||
let interpreter = PythonInstallation::find_or_fetch(
|
||||
let interpreter = PythonInstallation::find_or_download(
|
||||
Some(request),
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
@ -240,11 +240,11 @@ async fn init_project(
|
|||
let client_builder = BaseClientBuilder::new()
|
||||
.connectivity(connectivity)
|
||||
.native_tls(native_tls);
|
||||
let interpreter = PythonInstallation::find_or_fetch(
|
||||
let interpreter = PythonInstallation::find_or_download(
|
||||
Some(request),
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
|
|
@ -18,7 +18,7 @@ use uv_dispatch::BuildDispatch;
|
|||
use uv_fs::CWD;
|
||||
use uv_git::ResolvedRepositoryReference;
|
||||
use uv_normalize::{PackageName, DEV_DEPENDENCIES};
|
||||
use uv_python::{Interpreter, PythonEnvironment, PythonFetch, PythonPreference, PythonRequest};
|
||||
use uv_python::{Interpreter, PythonDownloads, PythonEnvironment, PythonPreference, PythonRequest};
|
||||
use uv_requirements::upgrade::{read_lock_requirements, LockedRequirements};
|
||||
use uv_resolver::{
|
||||
FlatIndex, Lock, OptionsBuilder, PythonRequirement, RequiresPython, ResolverMarkers,
|
||||
|
@ -50,7 +50,7 @@ pub(crate) async fn lock(
|
|||
settings: ResolverSettings,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
native_tls: bool,
|
||||
|
@ -69,7 +69,7 @@ pub(crate) async fn lock(
|
|||
&workspace,
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -20,8 +20,8 @@ use uv_fs::Simplified;
|
|||
use uv_installer::{SatisfiesResult, SitePackages};
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{
|
||||
request_from_version_file, EnvironmentPreference, Interpreter, PythonEnvironment, PythonFetch,
|
||||
PythonInstallation, PythonPreference, PythonRequest, VersionRequest,
|
||||
request_from_version_file, EnvironmentPreference, Interpreter, PythonDownloads,
|
||||
PythonEnvironment, PythonInstallation, PythonPreference, PythonRequest, VersionRequest,
|
||||
};
|
||||
use uv_requirements::{NamedRequirementsResolver, RequirementsSpecification};
|
||||
use uv_resolver::{
|
||||
|
@ -202,7 +202,7 @@ impl FoundInterpreter {
|
|||
workspace: &Workspace,
|
||||
python_request: Option<PythonRequest>,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
native_tls: bool,
|
||||
cache: &Cache,
|
||||
|
@ -251,11 +251,11 @@ impl FoundInterpreter {
|
|||
let reporter = PythonDownloadReporter::single(printer);
|
||||
|
||||
// Locate the Python interpreter to use in the environment
|
||||
let python = PythonInstallation::find_or_fetch(
|
||||
let python = PythonInstallation::find_or_download(
|
||||
python_request,
|
||||
EnvironmentPreference::OnlySystem,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
@ -329,7 +329,7 @@ pub(crate) async fn get_or_init_environment(
|
|||
workspace: &Workspace,
|
||||
python: Option<PythonRequest>,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
native_tls: bool,
|
||||
cache: &Cache,
|
||||
|
@ -339,7 +339,7 @@ pub(crate) async fn get_or_init_environment(
|
|||
workspace,
|
||||
python,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -5,7 +5,7 @@ use uv_cache::Cache;
|
|||
use uv_client::Connectivity;
|
||||
use uv_configuration::{Concurrency, ExtrasSpecification, PreviewMode};
|
||||
use uv_fs::CWD;
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonRequest};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonRequest};
|
||||
use uv_warnings::{warn_user, warn_user_once};
|
||||
use uv_workspace::pyproject::DependencyType;
|
||||
use uv_workspace::pyproject_mut::PyProjectTomlMut;
|
||||
|
@ -29,7 +29,7 @@ pub(crate) async fn remove(
|
|||
python: Option<String>,
|
||||
settings: ResolverInstallerSettings,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
preview: PreviewMode,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
|
@ -101,7 +101,7 @@ pub(crate) async fn remove(
|
|||
project.workspace(),
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -18,8 +18,8 @@ use uv_fs::{PythonExt, Simplified, CWD};
|
|||
use uv_installer::{SatisfiesResult, SitePackages};
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{
|
||||
request_from_version_file, EnvironmentPreference, Interpreter, PythonEnvironment, PythonFetch,
|
||||
PythonInstallation, PythonPreference, PythonRequest, VersionRequest,
|
||||
request_from_version_file, EnvironmentPreference, Interpreter, PythonDownloads,
|
||||
PythonEnvironment, PythonInstallation, PythonPreference, PythonRequest, VersionRequest,
|
||||
};
|
||||
use uv_requirements::{RequirementsSource, RequirementsSpecification};
|
||||
use uv_warnings::warn_user_once;
|
||||
|
@ -53,7 +53,7 @@ pub(crate) async fn run(
|
|||
settings: ResolverInstallerSettings,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
native_tls: bool,
|
||||
|
@ -122,11 +122,11 @@ pub(crate) async fn run(
|
|||
.connectivity(connectivity)
|
||||
.native_tls(native_tls);
|
||||
|
||||
let interpreter = PythonInstallation::find_or_fetch(
|
||||
let interpreter = PythonInstallation::find_or_download(
|
||||
python_request,
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&download_reporter),
|
||||
|
@ -240,11 +240,11 @@ pub(crate) async fn run(
|
|||
.await?;
|
||||
|
||||
// Note we force preview on during `uv run` for now since the entire interface is in preview.
|
||||
PythonInstallation::find_or_fetch(
|
||||
PythonInstallation::find_or_download(
|
||||
python_request,
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&download_reporter),
|
||||
|
@ -270,7 +270,7 @@ pub(crate) async fn run(
|
|||
project.workspace(),
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
@ -342,12 +342,12 @@ pub(crate) async fn run(
|
|||
.connectivity(connectivity)
|
||||
.native_tls(native_tls);
|
||||
|
||||
let python = PythonInstallation::find_or_fetch(
|
||||
let python = PythonInstallation::find_or_download(
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
// No opt-in is required for system environments, since we are not mutating it.
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&download_reporter),
|
||||
|
@ -460,11 +460,11 @@ pub(crate) async fn run(
|
|||
.native_tls(native_tls);
|
||||
|
||||
// Note we force preview on during `uv run` for now since the entire interface is in preview
|
||||
PythonInstallation::find_or_fetch(
|
||||
PythonInstallation::find_or_download(
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
EnvironmentPreference::Any,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&download_reporter),
|
||||
|
|
|
@ -10,7 +10,7 @@ use uv_dispatch::BuildDispatch;
|
|||
use uv_fs::CWD;
|
||||
use uv_installer::SitePackages;
|
||||
use uv_normalize::{PackageName, DEV_DEPENDENCIES};
|
||||
use uv_python::{PythonEnvironment, PythonFetch, PythonPreference, PythonRequest};
|
||||
use uv_python::{PythonDownloads, PythonEnvironment, PythonPreference, PythonRequest};
|
||||
use uv_resolver::{FlatIndex, Lock};
|
||||
use uv_types::{BuildIsolation, HashStrategy};
|
||||
use uv_warnings::warn_user_once;
|
||||
|
@ -35,7 +35,7 @@ pub(crate) async fn sync(
|
|||
modifications: Modifications,
|
||||
python: Option<String>,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
settings: ResolverInstallerSettings,
|
||||
preview: PreviewMode,
|
||||
connectivity: Connectivity,
|
||||
|
@ -65,7 +65,7 @@ pub(crate) async fn sync(
|
|||
project.workspace(),
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -8,7 +8,7 @@ use uv_cache::Cache;
|
|||
use uv_client::Connectivity;
|
||||
use uv_configuration::{Concurrency, PreviewMode, TargetTriple};
|
||||
use uv_fs::CWD;
|
||||
use uv_python::{PythonFetch, PythonPreference, PythonRequest, PythonVersion};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonRequest, PythonVersion};
|
||||
use uv_resolver::TreeDisplay;
|
||||
use uv_warnings::warn_user_once;
|
||||
use uv_workspace::{DiscoveryOptions, Workspace};
|
||||
|
@ -35,7 +35,7 @@ pub(crate) async fn tree(
|
|||
python: Option<String>,
|
||||
settings: ResolverSettings,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
preview: PreviewMode,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
|
@ -55,7 +55,7 @@ pub(crate) async fn tree(
|
|||
&workspace,
|
||||
python.as_deref().map(PythonRequest::parse),
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
native_tls,
|
||||
cache,
|
||||
|
|
|
@ -15,7 +15,8 @@ use uv_fs::CWD;
|
|||
use uv_python::downloads::{DownloadResult, ManagedPythonDownload, PythonDownloadRequest};
|
||||
use uv_python::managed::{ManagedPythonInstallation, ManagedPythonInstallations};
|
||||
use uv_python::{
|
||||
requests_from_version_file, PythonRequest, PYTHON_VERSIONS_FILENAME, PYTHON_VERSION_FILENAME,
|
||||
requests_from_version_file, PythonDownloads, PythonRequest, PYTHON_VERSIONS_FILENAME,
|
||||
PYTHON_VERSION_FILENAME,
|
||||
};
|
||||
use uv_warnings::warn_user_once;
|
||||
|
||||
|
@ -28,6 +29,7 @@ use crate::printer::Printer;
|
|||
pub(crate) async fn install(
|
||||
targets: Vec<String>,
|
||||
reinstall: bool,
|
||||
python_downloads: PythonDownloads,
|
||||
native_tls: bool,
|
||||
connectivity: Connectivity,
|
||||
preview: PreviewMode,
|
||||
|
@ -124,6 +126,14 @@ pub(crate) async fn install(
|
|||
return Ok(ExitStatus::Success);
|
||||
}
|
||||
|
||||
if matches!(python_downloads, PythonDownloads::Never) {
|
||||
writeln!(
|
||||
printer.stderr(),
|
||||
"Python downloads are not allowed (`python-downloads = \"never\"`). Change to `python-downloads = \"manual\"` to allow explicit installs.",
|
||||
)?;
|
||||
return Ok(ExitStatus::Failure);
|
||||
}
|
||||
|
||||
let downloads = unfilled_requests
|
||||
.into_iter()
|
||||
// Populate the download requests with defaults
|
||||
|
|
|
@ -9,7 +9,7 @@ use uv_configuration::PreviewMode;
|
|||
use uv_fs::Simplified;
|
||||
use uv_python::downloads::PythonDownloadRequest;
|
||||
use uv_python::{
|
||||
find_python_installations, DiscoveryError, EnvironmentPreference, PythonFetch,
|
||||
find_python_installations, DiscoveryError, EnvironmentPreference, PythonDownloads,
|
||||
PythonInstallation, PythonNotFound, PythonPreference, PythonRequest, PythonSource,
|
||||
};
|
||||
use uv_warnings::warn_user_once;
|
||||
|
@ -32,7 +32,7 @@ pub(crate) async fn list(
|
|||
all_versions: bool,
|
||||
all_platforms: bool,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
preview: PreviewMode,
|
||||
cache: &Cache,
|
||||
printer: Printer,
|
||||
|
@ -46,7 +46,7 @@ pub(crate) async fn list(
|
|||
let download_request = match kinds {
|
||||
PythonListKinds::Installed => None,
|
||||
PythonListKinds::Default => {
|
||||
if python_fetch.is_automatic() {
|
||||
if python_downloads.is_automatic() {
|
||||
Some(if all_platforms {
|
||||
PythonDownloadRequest::default()
|
||||
} else {
|
||||
|
|
|
@ -11,7 +11,7 @@ use uv_client::{BaseClientBuilder, Connectivity};
|
|||
use uv_configuration::{Concurrency, PreviewMode};
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{
|
||||
EnvironmentPreference, PythonFetch, PythonInstallation, PythonPreference, PythonRequest,
|
||||
EnvironmentPreference, PythonDownloads, PythonInstallation, PythonPreference, PythonRequest,
|
||||
};
|
||||
use uv_requirements::{RequirementsSource, RequirementsSpecification};
|
||||
use uv_tool::InstalledTools;
|
||||
|
@ -40,7 +40,7 @@ pub(crate) async fn install(
|
|||
settings: ResolverInstallerSettings,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
native_tls: bool,
|
||||
|
@ -61,11 +61,11 @@ pub(crate) async fn install(
|
|||
|
||||
// Pre-emptively identify a Python interpreter. We need an interpreter to resolve any unnamed
|
||||
// requirements, even if we end up using a different interpreter for the tool install itself.
|
||||
let interpreter = PythonInstallation::find_or_fetch(
|
||||
let interpreter = PythonInstallation::find_or_download(
|
||||
python_request.clone(),
|
||||
EnvironmentPreference::OnlySystem,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
|
|
@ -20,8 +20,8 @@ use uv_configuration::{Concurrency, PreviewMode};
|
|||
use uv_installer::{SatisfiesResult, SitePackages};
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{
|
||||
EnvironmentPreference, PythonEnvironment, PythonFetch, PythonInstallation, PythonPreference,
|
||||
PythonRequest,
|
||||
EnvironmentPreference, PythonDownloads, PythonEnvironment, PythonInstallation,
|
||||
PythonPreference, PythonRequest,
|
||||
};
|
||||
use uv_requirements::{RequirementsSource, RequirementsSpecification};
|
||||
use uv_tool::{entrypoint_paths, InstalledTools};
|
||||
|
@ -70,7 +70,7 @@ pub(crate) async fn run(
|
|||
isolated: bool,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
native_tls: bool,
|
||||
|
@ -107,7 +107,7 @@ pub(crate) async fn run(
|
|||
isolated,
|
||||
preview,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
connectivity,
|
||||
concurrency,
|
||||
native_tls,
|
||||
|
@ -293,7 +293,7 @@ async fn get_or_create_environment(
|
|||
isolated: bool,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
connectivity: Connectivity,
|
||||
concurrency: Concurrency,
|
||||
native_tls: bool,
|
||||
|
@ -309,11 +309,11 @@ async fn get_or_create_environment(
|
|||
let python_request = python.map(PythonRequest::parse);
|
||||
|
||||
// Discover an interpreter.
|
||||
let interpreter = PythonInstallation::find_or_fetch(
|
||||
let interpreter = PythonInstallation::find_or_download(
|
||||
python_request.clone(),
|
||||
EnvironmentPreference::OnlySystem,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
|
|
@ -22,7 +22,7 @@ use uv_configuration::{
|
|||
use uv_dispatch::BuildDispatch;
|
||||
use uv_fs::{Simplified, CWD};
|
||||
use uv_python::{
|
||||
request_from_version_file, EnvironmentPreference, PythonFetch, PythonInstallation,
|
||||
request_from_version_file, EnvironmentPreference, PythonDownloads, PythonInstallation,
|
||||
PythonPreference, PythonRequest, VersionRequest,
|
||||
};
|
||||
use uv_resolver::{ExcludeNewer, FlatIndex, RequiresPython};
|
||||
|
@ -42,7 +42,7 @@ pub(crate) async fn venv(
|
|||
path: &Path,
|
||||
python_request: Option<&str>,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
link_mode: LinkMode,
|
||||
index_locations: &IndexLocations,
|
||||
index_strategy: IndexStrategy,
|
||||
|
@ -72,7 +72,7 @@ pub(crate) async fn venv(
|
|||
seed,
|
||||
preview,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
allow_existing,
|
||||
exclude_newer,
|
||||
native_tls,
|
||||
|
@ -124,7 +124,7 @@ async fn venv_impl(
|
|||
seed: bool,
|
||||
preview: PreviewMode,
|
||||
python_preference: PythonPreference,
|
||||
python_fetch: PythonFetch,
|
||||
python_downloads: PythonDownloads,
|
||||
allow_existing: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
native_tls: bool,
|
||||
|
@ -174,11 +174,11 @@ async fn venv_impl(
|
|||
}
|
||||
|
||||
// Locate the Python interpreter to use in the environment
|
||||
let python = PythonInstallation::find_or_fetch(
|
||||
let python = PythonInstallation::find_or_download(
|
||||
interpreter_request,
|
||||
EnvironmentPreference::OnlySystem,
|
||||
python_preference,
|
||||
python_fetch,
|
||||
python_downloads,
|
||||
&client_builder,
|
||||
cache,
|
||||
Some(&reporter),
|
||||
|
|
|
@ -662,7 +662,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
|||
&args.name,
|
||||
args.settings.python.as_deref(),
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
args.settings.link_mode,
|
||||
&args.settings.index_locations,
|
||||
args.settings.index_strategy,
|
||||
|
@ -739,7 +739,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
|||
args.isolated,
|
||||
globals.preview,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
globals.native_tls,
|
||||
|
@ -783,7 +783,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
|||
args.settings,
|
||||
globals.preview,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
globals.native_tls,
|
||||
|
@ -866,7 +866,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
|||
args.all_versions,
|
||||
args.all_platforms,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.preview,
|
||||
&cache,
|
||||
printer,
|
||||
|
@ -886,6 +886,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
|||
commands::python_install(
|
||||
args.targets,
|
||||
args.reinstall,
|
||||
globals.python_downloads,
|
||||
globals.native_tls,
|
||||
globals.connectivity,
|
||||
globals.preview,
|
||||
|
@ -992,7 +993,7 @@ async fn run_project(
|
|||
args.no_workspace,
|
||||
globals.preview,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.connectivity,
|
||||
globals.native_tls,
|
||||
&cache,
|
||||
|
@ -1038,7 +1039,7 @@ async fn run_project(
|
|||
args.settings,
|
||||
globals.preview,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
globals.native_tls,
|
||||
|
@ -1068,7 +1069,7 @@ async fn run_project(
|
|||
args.modifications,
|
||||
args.python,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
args.settings,
|
||||
globals.preview,
|
||||
globals.connectivity,
|
||||
|
@ -1094,7 +1095,7 @@ async fn run_project(
|
|||
args.settings,
|
||||
globals.preview,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
globals.native_tls,
|
||||
|
@ -1131,7 +1132,7 @@ async fn run_project(
|
|||
args.python,
|
||||
args.settings,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.preview,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
|
@ -1163,7 +1164,7 @@ async fn run_project(
|
|||
args.python,
|
||||
args.settings,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.preview,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
|
@ -1195,7 +1196,7 @@ async fn run_project(
|
|||
args.python,
|
||||
args.resolver,
|
||||
globals.python_preference,
|
||||
globals.python_fetch,
|
||||
globals.python_downloads,
|
||||
globals.preview,
|
||||
globals.connectivity,
|
||||
Concurrency::default(),
|
||||
|
|
|
@ -27,7 +27,7 @@ use uv_configuration::{
|
|||
SourceStrategy, TargetTriple, Upgrade,
|
||||
};
|
||||
use uv_normalize::PackageName;
|
||||
use uv_python::{Prefix, PythonFetch, PythonPreference, PythonVersion, Target};
|
||||
use uv_python::{Prefix, PythonDownloads, PythonPreference, PythonVersion, Target};
|
||||
use uv_requirements::RequirementsSource;
|
||||
use uv_resolver::{AnnotationStyle, DependencyMode, ExcludeNewer, PrereleaseMode, ResolutionMode};
|
||||
use uv_settings::{
|
||||
|
@ -50,7 +50,7 @@ pub(crate) struct GlobalSettings {
|
|||
pub(crate) show_settings: bool,
|
||||
pub(crate) preview: PreviewMode,
|
||||
pub(crate) python_preference: PythonPreference,
|
||||
pub(crate) python_fetch: PythonFetch,
|
||||
pub(crate) python_downloads: PythonDownloads,
|
||||
pub(crate) no_progress: bool,
|
||||
}
|
||||
|
||||
|
@ -117,9 +117,9 @@ impl GlobalSettings {
|
|||
.python_preference
|
||||
.combine(workspace.and_then(|workspace| workspace.globals.python_preference))
|
||||
.unwrap_or(default_python_preference),
|
||||
python_fetch: args
|
||||
.python_fetch
|
||||
.combine(workspace.and_then(|workspace| workspace.globals.python_fetch))
|
||||
python_downloads: flag(args.allow_python_downloads, args.no_python_downloads)
|
||||
.map(PythonDownloads::from)
|
||||
.combine(workspace.and_then(|workspace| workspace.globals.python_downloads))
|
||||
.unwrap_or_default(),
|
||||
no_progress: args.no_progress,
|
||||
}
|
||||
|
|
|
@ -40,9 +40,8 @@ fn help() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -103,9 +102,8 @@ fn help_flag() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -165,9 +163,8 @@ fn help_short_flag() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -212,7 +209,7 @@ fn help_subcommand() {
|
|||
|
||||
When preview is enabled, i.e., via `--preview` or by using a preview
|
||||
command, uv will download Python if a version cannot be found. This
|
||||
behavior can be disabled with the `--python-fetch` option.
|
||||
behavior can be disabled with the `--python-downloads` option.
|
||||
|
||||
The `--python` option allows requesting a different interpreter.
|
||||
|
||||
|
@ -281,13 +278,8 @@ fn help_subcommand() {
|
|||
- only-system: Only use system Python installations; never use managed Python
|
||||
installations
|
||||
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required
|
||||
|
||||
Possible values:
|
||||
- automatic: Automatically fetch managed Python installations when needed
|
||||
- manual: Do not automatically fetch managed Python installations; require explicit
|
||||
installation
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet
|
||||
|
@ -419,13 +411,8 @@ fn help_subsubcommand() {
|
|||
- only-system: Only use system Python installations; never use managed Python
|
||||
installations
|
||||
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required
|
||||
|
||||
Possible values:
|
||||
- automatic: Automatically fetch managed Python installations when needed
|
||||
- manual: Do not automatically fetch managed Python installations; require explicit
|
||||
installation
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet
|
||||
|
@ -527,9 +514,8 @@ fn help_flag_subcommand() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -580,9 +566,8 @@ fn help_flag_subsubcommand() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -710,9 +695,8 @@ fn help_with_global_option() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
@ -809,9 +793,8 @@ fn help_with_no_pager() {
|
|||
--python-preference <PYTHON_PREFERENCE>
|
||||
Whether to prefer uv-managed or system Python installations [possible values:
|
||||
only-managed, managed, system, only-system]
|
||||
--python-fetch <PYTHON_FETCH>
|
||||
Whether to automatically download Python when required [possible values: automatic,
|
||||
manual]
|
||||
--no-python-downloads
|
||||
Disable automatic downloads of Python
|
||||
|
||||
Global options:
|
||||
-q, --quiet Do not print any output
|
||||
|
|
|
@ -3061,7 +3061,7 @@ fn lock_requires_python() -> Result<()> {
|
|||
|
||||
// Install from the lockfile.
|
||||
// Note we need to disable Python fetches or we'll just download 3.12
|
||||
uv_snapshot!(filters, context38.sync().arg("--frozen").arg("--python-fetch").arg("manual"), @r###"
|
||||
uv_snapshot!(filters, context38.sync().arg("--frozen").arg("--no-python-downloads"), @r###"
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
|
|
|
@ -56,7 +56,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -192,7 +192,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -329,7 +329,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -498,7 +498,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -636,7 +636,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -760,7 +760,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -921,7 +921,7 @@ fn resolve_index_url() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1082,7 +1082,7 @@ fn resolve_index_url() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1288,7 +1288,7 @@ fn resolve_find_links() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1448,7 +1448,7 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1578,7 +1578,7 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1736,7 +1736,7 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -1918,7 +1918,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2038,7 +2038,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2158,7 +2158,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2280,7 +2280,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2421,7 +2421,7 @@ fn resolve_tool() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2534,7 +2534,7 @@ fn resolve_poetry_toml() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2682,7 +2682,7 @@ fn resolve_both() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -2845,7 +2845,7 @@ fn resolve_config_file() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -3083,7 +3083,7 @@ fn resolve_skip_empty() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
@ -3206,7 +3206,7 @@ fn resolve_skip_empty() -> anyhow::Result<()> {
|
|||
show_settings: true,
|
||||
preview: Disabled,
|
||||
python_preference: OnlySystem,
|
||||
python_fetch: Automatic,
|
||||
python_downloads: Automatic,
|
||||
no_progress: false,
|
||||
}
|
||||
CacheSettings {
|
||||
|
|
|
@ -47,7 +47,7 @@ Additionally, a specific system Python interpreter can be requested with:
|
|||
|
||||
By default, uv will automatically download Python versions if they cannot be found on the system.
|
||||
This behavior can be
|
||||
[disabled with the `python-fetch` option](#disabling-automatic-python-downloads).
|
||||
[disabled with the `python-downloads` option](#disabling-automatic-python-downloads).
|
||||
|
||||
## Installing a Python version
|
||||
|
||||
|
@ -155,7 +155,7 @@ version download.
|
|||
|
||||
By default, uv will automatically download Python versions when needed.
|
||||
|
||||
The `python-fetch` option can be used to disable this behavior. By default, it is set to
|
||||
The `python-downloads` option can be used to disable this behavior. By default, it is set to
|
||||
`automatic`; set to `manual` to only allow Python downloads during `uv python install`.
|
||||
|
||||
## Adjusting Python version preferences
|
||||
|
|
|
@ -235,6 +235,8 @@ uv run [OPTIONS] <COMMAND>
|
|||
|
||||
<p>If a virtual environment is active or found in a current or parent directory, it will be used as if there was no project or workspace.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -268,15 +270,6 @@ uv run [OPTIONS] <COMMAND>
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> to view supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -409,6 +402,8 @@ uv init [OPTIONS] [PATH]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-readme</code></dt><dd><p>Do not create a <code>README.md</code> file</p>
|
||||
|
||||
</dd><dt><code>--no-workspace</code></dt><dd><p>Avoid discovering a workspace.</p>
|
||||
|
@ -425,15 +420,6 @@ uv init [OPTIONS] [PATH]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> to view supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -642,6 +628,8 @@ uv add [OPTIONS] <REQUIREMENTS>...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--no-sync</code></dt><dd><p>Avoid syncing the virtual environment after re-locking the project</p>
|
||||
|
@ -679,15 +667,6 @@ uv add [OPTIONS] <REQUIREMENTS>...
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -915,6 +894,8 @@ uv remove [OPTIONS] <PACKAGES>...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--no-sync</code></dt><dd><p>Avoid syncing the virtual environment after re-locking the project</p>
|
||||
|
@ -948,15 +929,6 @@ uv remove [OPTIONS] <PACKAGES>...
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -1168,6 +1140,8 @@ uv sync [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -1201,15 +1175,6 @@ uv sync [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -1409,6 +1374,8 @@ uv lock [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -1440,15 +1407,6 @@ uv lock [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -1649,6 +1607,8 @@ uv tree [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -1682,15 +1642,6 @@ uv tree [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform to use when filtering the tree.</p>
|
||||
|
||||
<p>For example, pass <code>--platform windows</code> to display the dependencies that would be included when installing on Windows.</p>
|
||||
|
@ -1963,6 +1914,8 @@ uv tool run [OPTIONS] [COMMAND]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -1990,15 +1943,6 @@ uv tool run [OPTIONS] [COMMAND]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2206,6 +2150,8 @@ uv tool install [OPTIONS] <PACKAGE>
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -2233,15 +2179,6 @@ uv tool install [OPTIONS] <PACKAGE>
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2447,6 +2384,8 @@ uv tool upgrade [OPTIONS] <NAME>
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -2470,15 +2409,6 @@ uv tool upgrade [OPTIONS] <NAME>
|
|||
|
||||
<li><code>if-necessary-or-explicit</code>: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2579,19 +2509,12 @@ uv tool list [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2677,19 +2600,12 @@ uv tool uninstall [OPTIONS] <NAME>
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2765,19 +2681,12 @@ uv tool update-shell [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2857,19 +2766,12 @@ uv tool dir [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -2910,7 +2812,7 @@ executables.
|
|||
|
||||
When preview is enabled, i.e., via `--preview` or by using a preview
|
||||
command, uv will download Python if a version cannot be found. This
|
||||
behavior can be disabled with the `--python-fetch` option.
|
||||
behavior can be disabled with the `--python-downloads` option.
|
||||
|
||||
The `--python` option allows requesting a different interpreter.
|
||||
|
||||
|
@ -3014,21 +2916,14 @@ uv python list [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--only-installed</code></dt><dd><p>Only show installed Python versions, exclude available downloads</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3114,19 +3009,12 @@ uv python install [OPTIONS] [TARGETS]...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3212,19 +3100,12 @@ uv python find [OPTIONS] [REQUEST]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3310,21 +3191,14 @@ uv python pin [OPTIONS] [REQUEST]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-workspace</code></dt><dd><p>Avoid validating the Python pin against the workspace in the current directory or any parent directory</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3404,19 +3278,12 @@ uv python dir [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3502,19 +3369,12 @@ uv python uninstall [OPTIONS] <TARGETS>...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -3770,6 +3630,8 @@ uv pip compile [OPTIONS] <SRC_FILE>...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--no-strip-extras</code></dt><dd><p>Include extras in the output file.</p>
|
||||
|
@ -3825,15 +3687,6 @@ uv pip compile [OPTIONS] <SRC_FILE>...
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform for which requirements should be resolved.</p>
|
||||
|
||||
<p>Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aaarch64-apple-darwin</code>.</p>
|
||||
|
@ -4104,6 +3957,8 @@ uv pip sync [OPTIONS] <SRC_FILE>...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -4126,15 +3981,6 @@ uv pip sync [OPTIONS] <SRC_FILE>...
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
|
||||
|
||||
<p>Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aaarch64-apple-darwin</code>.</p>
|
||||
|
@ -4416,6 +4262,8 @@ uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITAB
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-sources</code></dt><dd><p>Ignore the <code>tool.uv.sources</code> table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any local or Git sources</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
@ -4461,15 +4309,6 @@ uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITAB
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
|
||||
|
||||
<p>Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aaarch64-apple-darwin</code>.</p>
|
||||
|
@ -4668,6 +4507,8 @@ uv pip uninstall [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>>
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -4680,15 +4521,6 @@ uv pip uninstall [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>>
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -4776,6 +4608,8 @@ uv pip freeze [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -4786,15 +4620,6 @@ uv pip freeze [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -4896,6 +4721,8 @@ uv pip list [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -4906,15 +4733,6 @@ uv pip list [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5004,6 +4822,8 @@ uv pip show [OPTIONS] [PACKAGE]...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -5014,15 +4834,6 @@ uv pip show [OPTIONS] [PACKAGE]...
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5113,6 +4924,8 @@ uv pip tree [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--no-system</code></dt><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -5127,15 +4940,6 @@ uv pip tree [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5221,6 +5025,8 @@ uv pip check [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -5231,15 +5037,6 @@ uv pip check [OPTIONS]
|
|||
|
||||
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5406,6 +5203,8 @@ uv venv [OPTIONS] [NAME]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
@ -5422,15 +5221,6 @@ uv venv [OPTIONS] [NAME]
|
|||
|
||||
<p>See <code>uv python help</code> for details on Python discovery and supported request formats.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5548,19 +5338,12 @@ uv cache clean [OPTIONS] [PACKAGE]...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5642,19 +5425,12 @@ uv cache prune [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5730,19 +5506,12 @@ uv cache dir [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
@ -5818,20 +5587,13 @@ uv version [OPTIONS]
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--output-format</code> <i>output-format</i></dt><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
</dd><dt><code>--output-format</code> <i>output-format</i></dt><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
||||
|
@ -5912,19 +5674,12 @@ uv help [OPTIONS] [COMMAND]...
|
|||
|
||||
<p>For example, spinners or progress bars.</p>
|
||||
|
||||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>
|
||||
|
||||
</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>
|
||||
|
||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
|
||||
|
||||
</dd><dt><code>--python-fetch</code> <i>python-fetch</i></dt><dd><p>Whether to automatically download Python when required</p>
|
||||
|
||||
<p>Possible values:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>automatic</code>: Automatically fetch managed Python installations when needed</li>
|
||||
|
||||
<li><code>manual</code>: Do not automatically fetch managed Python installations; require explicit installation</li>
|
||||
</ul>
|
||||
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||
|
||||
<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>
|
||||
|
|
|
@ -693,16 +693,17 @@ Whether to enable experimental, preview features.
|
|||
|
||||
---
|
||||
|
||||
#### [`python-fetch`](#python-fetch) {: #python-fetch }
|
||||
#### [`python-downloads`](#python-downloads) {: #python-downloads }
|
||||
|
||||
Whether to automatically download Python when required.
|
||||
Whether to allow Python downloads.
|
||||
|
||||
**Default value**: `"automatic"`
|
||||
|
||||
**Possible values**:
|
||||
|
||||
- `"automatic"`: Automatically fetch managed Python installations when needed
|
||||
- `"manual"`: Do not automatically fetch managed Python installations; require explicit installation
|
||||
- `"automatic"`: Automatically download managed Python installations when needed
|
||||
- `"manual"`: Do not automatically download managed Python installations; require explicit installation
|
||||
- `"never"`: Do not ever allow Python downloads
|
||||
|
||||
**Example usage**:
|
||||
|
||||
|
@ -710,13 +711,13 @@ Whether to automatically download Python when required.
|
|||
|
||||
```toml
|
||||
[tool.uv]
|
||||
python-fetch = "manual"
|
||||
python-downloads = "manual"
|
||||
```
|
||||
=== "uv.toml"
|
||||
|
||||
```toml
|
||||
|
||||
python-fetch = "manual"
|
||||
python-downloads = "manual"
|
||||
```
|
||||
|
||||
---
|
||||
|
|
19
uv.schema.json
generated
19
uv.schema.json
generated
|
@ -254,11 +254,11 @@
|
|||
"null"
|
||||
]
|
||||
},
|
||||
"python-fetch": {
|
||||
"description": "Whether to automatically download Python when required.",
|
||||
"python-downloads": {
|
||||
"description": "Whether to allow Python downloads.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/PythonFetch"
|
||||
"$ref": "#/definitions/PythonDownloads"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
@ -1015,21 +1015,28 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"PythonFetch": {
|
||||
"PythonDownloads": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Automatically fetch managed Python installations when needed.",
|
||||
"description": "Automatically download managed Python installations when needed.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"automatic"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Do not automatically fetch managed Python installations; require explicit installation.",
|
||||
"description": "Do not automatically download managed Python installations; require explicit installation.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"manual"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Do not ever allow Python downloads.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"never"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue