mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 15:01:16 +00:00
Fetch managed toolchains in uv run
(#4143)
This commit is contained in:
parent
45df889fe4
commit
a2e6aaa0ff
1 changed files with 7 additions and 3 deletions
|
@ -9,7 +9,7 @@ use tokio::process::Command;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use uv_cache::Cache;
|
use uv_cache::Cache;
|
||||||
use uv_client::Connectivity;
|
use uv_client::{BaseClientBuilder, Connectivity};
|
||||||
use uv_configuration::{ExtrasSpecification, PreviewMode, Upgrade};
|
use uv_configuration::{ExtrasSpecification, PreviewMode, Upgrade};
|
||||||
use uv_distribution::{ProjectWorkspace, Workspace};
|
use uv_distribution::{ProjectWorkspace, Workspace};
|
||||||
use uv_normalize::PackageName;
|
use uv_normalize::PackageName;
|
||||||
|
@ -40,6 +40,8 @@ pub(crate) async fn run(
|
||||||
cache: &Cache,
|
cache: &Cache,
|
||||||
printer: Printer,
|
printer: Printer,
|
||||||
) -> Result<ExitStatus> {
|
) -> Result<ExitStatus> {
|
||||||
|
let client_builder = BaseClientBuilder::new().connectivity(connectivity);
|
||||||
|
|
||||||
if preview.is_disabled() {
|
if preview.is_disabled() {
|
||||||
warn_user!("`uv run` is experimental and may change without warning.");
|
warn_user!("`uv run` is experimental and may change without warning.");
|
||||||
}
|
}
|
||||||
|
@ -110,12 +112,14 @@ pub(crate) async fn run(
|
||||||
project_env.interpreter().clone()
|
project_env.interpreter().clone()
|
||||||
} else {
|
} else {
|
||||||
// Note we force preview on during `uv run` for now since the entire interface is in preview
|
// 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(),
|
python.as_deref(),
|
||||||
SystemPython::Allowed,
|
SystemPython::Allowed,
|
||||||
PreviewMode::Enabled,
|
PreviewMode::Enabled,
|
||||||
|
client_builder,
|
||||||
cache,
|
cache,
|
||||||
)?
|
)
|
||||||
|
.await?
|
||||||
.into_interpreter()
|
.into_interpreter()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue