From a2e6aaa0ff54d7e00e687f446c25ee69ded38bdf Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 10 Jun 2024 10:20:44 -0400 Subject: [PATCH] Fetch managed toolchains in `uv run` (#4143) --- crates/uv/src/commands/project/run.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 04c263326..ec755056d 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -9,7 +9,7 @@ use tokio::process::Command; use tracing::debug; use uv_cache::Cache; -use uv_client::Connectivity; +use uv_client::{BaseClientBuilder, Connectivity}; use uv_configuration::{ExtrasSpecification, PreviewMode, Upgrade}; use uv_distribution::{ProjectWorkspace, Workspace}; use uv_normalize::PackageName; @@ -40,6 +40,8 @@ pub(crate) async fn run( cache: &Cache, printer: Printer, ) -> Result { + let client_builder = BaseClientBuilder::new().connectivity(connectivity); + if preview.is_disabled() { warn_user!("`uv run` is experimental and may change without warning."); } @@ -110,12 +112,14 @@ pub(crate) async fn run( project_env.interpreter().clone() } else { // Note we force preview on during `uv run` for now since the entire interface is in preview - Toolchain::find( + Toolchain::find_or_fetch( python.as_deref(), SystemPython::Allowed, PreviewMode::Enabled, + client_builder, cache, - )? + ) + .await? .into_interpreter() };