mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Avoid displaying "failed to download" on build failures for local source distributions (#6075)
Especially with workspace members (e.g., [this new test case](https://github.com/astral-sh/uv/pull/6073/files#diff-273076013b4f5a8139defd5dcd24f5d1eb91c0266dceb4448fdeddceb79f7738R1377-R1379)), I find it very confusing that we say we failed to download these distributions.
This commit is contained in:
parent
dc67023677
commit
359f39ca0f
9 changed files with 25 additions and 23 deletions
|
@ -46,8 +46,8 @@ pub enum Error {
|
|||
CacheEncode(#[from] rmp_serde::encode::Error),
|
||||
|
||||
// Build error
|
||||
#[error("Failed to build: `{0}`")]
|
||||
Build(String, #[source] anyhow::Error),
|
||||
#[error(transparent)]
|
||||
Build(anyhow::Error),
|
||||
#[error("Failed to build editable: `{0}`")]
|
||||
BuildEditable(String, #[source] anyhow::Error),
|
||||
#[error("Built wheel has an invalid filename")]
|
||||
|
|
|
@ -1464,10 +1464,10 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
},
|
||||
)
|
||||
.await
|
||||
.map_err(|err| Error::Build(source.to_string(), err))?
|
||||
.map_err(Error::Build)?
|
||||
.wheel(cache_shard)
|
||||
.await
|
||||
.map_err(|err| Error::Build(source.to_string(), err))?;
|
||||
.map_err(Error::Build)?;
|
||||
|
||||
// Read the metadata from the wheel.
|
||||
let filename = WheelFilename::from_str(&disk_filename)?;
|
||||
|
@ -1555,13 +1555,10 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
},
|
||||
)
|
||||
.await
|
||||
.map_err(|err| Error::Build(source.to_string(), err))?;
|
||||
.map_err(Error::Build)?;
|
||||
|
||||
// Build the metadata.
|
||||
let dist_info = builder
|
||||
.metadata()
|
||||
.await
|
||||
.map_err(|err| Error::Build(source.to_string(), err))?;
|
||||
let dist_info = builder.metadata().await.map_err(Error::Build)?;
|
||||
let Some(dist_info) = dist_info else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue