Use dist info name in cache again (#331)

Fixup for the `PackageName`/`DistInfoName` refactor that would lead to
invalid cache entries
This commit is contained in:
konsti 2023-11-06 14:47:38 +01:00 committed by GitHub
parent 6d672b8951
commit 3defe233e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,11 @@ impl RemoteDistribution {
Self::Registry(name, version, _) => {
// https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-dist-info-directory
// `version` is normalized by its `ToString` impl
format!("{}-{}", PackageName::from(name), version)
format!(
"{}-{}",
PackageName::from(name).as_dist_info_name(),
version
)
}
Self::Url(_name, url) => puffin_cache::digest(&CanonicalUrl::new(url)),
}