diff --git a/crates/uv-distribution/src/error.rs b/crates/uv-distribution/src/error.rs index 9f6de3744..156d35eab 100644 --- a/crates/uv-distribution/src/error.rs +++ b/crates/uv-distribution/src/error.rs @@ -53,7 +53,7 @@ pub enum Error { Zip(#[from] ZipError), #[error("Source distribution directory contains neither readable pyproject.toml nor setup.py")] DirWithoutEntrypoint, - #[error("Failed to extract source distribution: {0}")] + #[error("Failed to extract source distribution")] Extract(#[from] uv_extract::Error), /// Should not occur; only seen when another task panicked. diff --git a/crates/uv-extract/src/error.rs b/crates/uv-extract/src/error.rs index c1d2ce641..520d35133 100644 --- a/crates/uv-extract/src/error.rs +++ b/crates/uv-extract/src/error.rs @@ -1,4 +1,4 @@ -use std::path::PathBuf; +use std::{ffi::OsString, path::PathBuf}; use zip::result::ZipError; @@ -15,5 +15,5 @@ pub enum Error { #[error( "The top level of the archive must only contain a list directory, but it contains: {0:?}" )] - InvalidArchive(Vec), + InvalidArchive(Vec), } diff --git a/crates/uv-extract/src/sync.rs b/crates/uv-extract/src/sync.rs index 6c8a15a99..d0ab1746e 100644 --- a/crates/uv-extract/src/sync.rs +++ b/crates/uv-extract/src/sync.rs @@ -116,7 +116,9 @@ pub fn strip_component(source: impl AsRef) -> Result { let top_level = fs_err::read_dir(source.as_ref())?.collect::>>()?; let [root] = top_level.as_slice() else { - return Err(Error::InvalidArchive(top_level)); + return Err(Error::InvalidArchive( + top_level.into_iter().map(|e| e.file_name()).collect(), + )); }; Ok(root.path()) }