diff --git a/crates/uv-distribution/src/error.rs b/crates/uv-distribution/src/error.rs index 94de2b0b4..3a9102976 100644 --- a/crates/uv-distribution/src/error.rs +++ b/crates/uv-distribution/src/error.rs @@ -1,4 +1,5 @@ use std::path::PathBuf; + use tokio::task::JoinError; use zip::result::ZipError; @@ -7,6 +8,7 @@ use distribution_types::ParsedUrlError; use pep440_rs::Version; use pypi_types::HashDigest; use uv_client::BetterReqwestError; +use uv_fs::Simplified; use uv_normalize::PackageName; #[derive(Debug, thiserror::Error)] @@ -60,8 +62,8 @@ pub enum Error { DistInfo(#[from] install_wheel_rs::Error), #[error("Failed to read zip archive from built wheel")] Zip(#[from] ZipError), - #[error("Source distribution directory contains neither readable pyproject.toml nor setup.py")] - DirWithoutEntrypoint, + #[error("Source distribution directory contains neither readable pyproject.toml nor setup.py: `{}`", _0.user_display())] + DirWithoutEntrypoint(PathBuf), #[error("Failed to extract archive")] Extract(#[from] uv_extract::Error), #[error("Source distribution not found at: {0}")] diff --git a/crates/uv-distribution/src/index/built_wheel_index.rs b/crates/uv-distribution/src/index/built_wheel_index.rs index 245c413f0..9b5f344dd 100644 --- a/crates/uv-distribution/src/index/built_wheel_index.rs +++ b/crates/uv-distribution/src/index/built_wheel_index.rs @@ -105,7 +105,7 @@ impl<'a> BuiltWheelIndex<'a> { let Some(modified) = ArchiveTimestamp::from_source_tree(&source_dist.path).map_err(Error::CacheRead)? else { - return Err(Error::DirWithoutEntrypoint); + return Err(Error::DirWithoutEntrypoint(source_dist.path.clone())); }; // If the distribution is stale, omit it from the index. diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index 80d5a95da..f8cb105c9 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -978,7 +978,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { let Some(modified) = ArchiveTimestamp::from_source_tree(&resource.path).map_err(Error::CacheRead)? else { - return Err(Error::DirWithoutEntrypoint); + return Err(Error::DirWithoutEntrypoint(resource.path.to_path_buf())); }; // Read the existing metadata from the cache.