diff --git a/crates/uv-client/src/html.rs b/crates/uv-client/src/html.rs index 5c27df26f..2fe521658 100644 --- a/crates/uv-client/src/html.rs +++ b/crates/uv-client/src/html.rs @@ -109,9 +109,15 @@ impl SimpleHtml { debug!("{err}"); Hashes::default() } - Err(err @ HashError::UnsupportedHashAlgorithm(..)) => { - // If the URL references a hash, but it's unsupported, error. - return Err(err.into()); + Err(HashError::UnsupportedHashAlgorithm(fragment)) => { + if fragment == "egg" { + // If the URL references an egg hash, ignore it. + debug!("{}", HashError::UnsupportedHashAlgorithm(fragment)); + Hashes::default() + } else { + // If the URL references a hash, but it's unsupported, error. + return Err(HashError::UnsupportedHashAlgorithm(fragment).into()); + } } } }, @@ -247,7 +253,7 @@ pub enum Error { MissingHash(String), #[error(transparent)] - FragmentParse(#[from] uv_pypi_types::HashError), + FragmentParse(#[from] HashError), #[error("Invalid `requires-python` specifier: {0}")] Pep440(#[source] uv_pep440::VersionSpecifiersParseError), @@ -908,6 +914,64 @@ mod tests { "###); } + #[test] + fn parse_egg_fragment() { + let text = r#" + + +
+