mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 13:14:41 +00:00
Allow multiple toolchains to be requested in uv toolchain install (#4334)
Allows installation of multiple toolchains in a single invocation because I don't want to be limited to one! Most of the implementation for concurrent downloads ported from `cargo dev fetch-python`.
This commit is contained in:
parent
4db6b902eb
commit
fdcdc2cbe6
8 changed files with 127 additions and 72 deletions
|
|
@ -15,7 +15,7 @@ use uv_client::BetterReqwestError;
|
|||
use futures::TryStreamExt;
|
||||
|
||||
use tokio_util::compat::FuturesAsyncReadCompatExt;
|
||||
use tracing::debug;
|
||||
use tracing::{debug, instrument};
|
||||
use url::Url;
|
||||
use uv_fs::Simplified;
|
||||
|
||||
|
|
@ -265,20 +265,30 @@ impl PythonDownloadRequest {
|
|||
impl Display for PythonDownloadRequest {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let mut parts = Vec::new();
|
||||
if let Some(version) = &self.version {
|
||||
parts.push(version.to_string());
|
||||
}
|
||||
if let Some(implementation) = self.implementation {
|
||||
parts.push(implementation.to_string());
|
||||
} else {
|
||||
parts.push("any".to_string());
|
||||
}
|
||||
if let Some(version) = &self.version {
|
||||
parts.push(version.to_string());
|
||||
} else {
|
||||
parts.push("any".to_string());
|
||||
}
|
||||
if let Some(os) = &self.os {
|
||||
parts.push(os.to_string());
|
||||
} else {
|
||||
parts.push("any".to_string());
|
||||
}
|
||||
if let Some(arch) = self.arch {
|
||||
parts.push(arch.to_string());
|
||||
} else {
|
||||
parts.push("any".to_string());
|
||||
}
|
||||
if let Some(libc) = self.libc {
|
||||
parts.push(libc.to_string());
|
||||
} else {
|
||||
parts.push("any".to_string());
|
||||
}
|
||||
write!(f, "{}", parts.join("-"))
|
||||
}
|
||||
|
|
@ -371,6 +381,7 @@ impl PythonDownload {
|
|||
}
|
||||
|
||||
/// Download and extract
|
||||
#[instrument(skip(client, parent_path), fields(download = %self.key()))]
|
||||
pub async fn fetch(
|
||||
&self,
|
||||
client: &uv_client::BaseClient,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue