mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Remove unused wheel cache argument from downloader (#248)
This commit is contained in:
parent
ae203f998a
commit
2f38701008
3 changed files with 4 additions and 12 deletions
|
@ -138,7 +138,6 @@ pub(crate) async fn sync_requirements(
|
|||
};
|
||||
|
||||
// Download any missing distributions.
|
||||
let staging = tempfile::tempdir()?;
|
||||
let downloads = if remote.is_empty() {
|
||||
vec![]
|
||||
} else {
|
||||
|
@ -147,9 +146,7 @@ pub(crate) async fn sync_requirements(
|
|||
let downloader = puffin_installer::Downloader::new(&client, cache)
|
||||
.with_reporter(DownloadReporter::from(printer).with_length(remote.len() as u64));
|
||||
|
||||
let downloads = downloader
|
||||
.download(remote, cache.unwrap_or(staging.path()))
|
||||
.await?;
|
||||
let downloads = downloader.download(remote).await?;
|
||||
|
||||
let s = if downloads.len() == 1 { "" } else { "s" };
|
||||
writeln!(
|
||||
|
@ -167,6 +164,7 @@ pub(crate) async fn sync_requirements(
|
|||
};
|
||||
|
||||
// Unzip any downloaded distributions.
|
||||
let staging = tempfile::tempdir()?;
|
||||
let unzips = if downloads.is_empty() {
|
||||
vec![]
|
||||
} else {
|
||||
|
|
|
@ -138,7 +138,6 @@ impl BuildContext for BuildDispatch {
|
|||
};
|
||||
|
||||
// Download any missing distributions.
|
||||
let staging = tempfile::tempdir()?;
|
||||
let downloads = if remote.is_empty() {
|
||||
vec![]
|
||||
} else {
|
||||
|
@ -148,12 +147,13 @@ impl BuildContext for BuildDispatch {
|
|||
remote.iter().map(ToString::to_string).join(", ")
|
||||
);
|
||||
Downloader::new(&self.client, self.cache.as_deref())
|
||||
.download(remote, self.cache.as_deref().unwrap_or(staging.path()))
|
||||
.download(remote)
|
||||
.await
|
||||
.context("Failed to download build dependencies")?
|
||||
};
|
||||
|
||||
// Unzip any downloaded distributions.
|
||||
let staging = tempfile::tempdir()?;
|
||||
let unzips = if downloads.is_empty() {
|
||||
vec![]
|
||||
} else {
|
||||
|
|
|
@ -12,7 +12,6 @@ use pep440_rs::Version;
|
|||
use puffin_client::RegistryClient;
|
||||
use puffin_package::package_name::PackageName;
|
||||
|
||||
use crate::cache::WheelCache;
|
||||
use crate::distribution::RemoteDistribution;
|
||||
|
||||
pub struct Downloader<'a> {
|
||||
|
@ -44,12 +43,7 @@ impl<'a> Downloader<'a> {
|
|||
pub async fn download(
|
||||
&'a self,
|
||||
wheels: Vec<RemoteDistribution>,
|
||||
target: &'a Path,
|
||||
) -> Result<Vec<InMemoryDistribution>> {
|
||||
// Create the wheel cache subdirectory, if necessary.
|
||||
let wheel_cache = WheelCache::new(target);
|
||||
wheel_cache.init()?;
|
||||
|
||||
// Sort the wheels by size.
|
||||
let mut wheels = wheels;
|
||||
wheels.sort_unstable_by_key(|wheel| Reverse(wheel.file().size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue