diff --git a/crates/uv/src/commands/python/install.rs b/crates/uv/src/commands/python/install.rs index dd9cf2471..c23a239f6 100644 --- a/crates/uv/src/commands/python/install.rs +++ b/crates/uv/src/commands/python/install.rs @@ -26,6 +26,7 @@ pub(crate) async fn install( native_tls: bool, connectivity: Connectivity, preview: PreviewMode, + isolated: bool, _cache: &Cache, printer: Printer, ) -> Result { @@ -41,7 +42,12 @@ pub(crate) async fn install( let targets = targets.into_iter().collect::>(); let requests: Vec<_> = if targets.is_empty() { - if let Some(requests) = requests_from_version_file().await? { + // Read from the version file, unless `isolated` was requested + if let Some(requests) = if isolated { + None + } else { + requests_from_version_file().await? + } { requests } else { vec![PythonRequest::Any] @@ -61,21 +67,29 @@ pub(crate) async fn install( let installed_installations: Vec<_> = installations.find_all()?.collect(); let mut unfilled_requests = Vec::new(); for (request, download_request) in requests.iter().zip(download_requests) { - writeln!( - printer.stderr(), - "Searching for Python versions matching: {}", - request.cyan() - )?; + if matches!(requests.as_slice(), [PythonRequest::Any]) { + writeln!(printer.stderr(), "Searching for Python installations")?; + } else { + writeln!( + printer.stderr(), + "Searching for Python versions matching: {}", + request.cyan() + )?; + } if let Some(installation) = installed_installations .iter() .find(|installation| download_request.satisfied_by_key(installation.key())) { - writeln!( - printer.stderr(), - "Found existing installation for {}: {}", - request.cyan(), - installation.key().green(), - )?; + if matches!(request, PythonRequest::Any) { + writeln!(printer.stderr(), "Found: {}", installation.key().green(),)?; + } else { + writeln!( + printer.stderr(), + "Found existing installation for {}: {}", + request.cyan(), + installation.key().green(), + )?; + } if force { writeln!( printer.stderr(), diff --git a/crates/uv/src/main.rs b/crates/uv/src/main.rs index 523bf8006..0e33183ff 100644 --- a/crates/uv/src/main.rs +++ b/crates/uv/src/main.rs @@ -776,6 +776,7 @@ async fn run() -> Result { globals.native_tls, globals.connectivity, globals.preview, + globals.isolated, &cache, printer, )