mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
Use separate representations for canonical repository vs. commit (#317)
Given `https://github.com/pypa/package.git#subdirectory=pkg_a` and `https://github.com/pypa/package.git#subdirectory=pkg_b`, we want these to map to the same shared _resource_ (for locking and cloning), but different _packages_ (for determining whether the wheel already exists in the cache). As such, we need two distinct concepts for "canonical equality". Closes #316.
This commit is contained in:
parent
b589813e59
commit
051188dce0
6 changed files with 192 additions and 25 deletions
|
@ -22,7 +22,7 @@ use waitmap::WaitMap;
|
|||
use distribution_filename::{SourceDistributionFilename, WheelFilename};
|
||||
use pep508_rs::{MarkerEnvironment, Requirement};
|
||||
use platform_tags::Tags;
|
||||
use puffin_cache::CanonicalUrl;
|
||||
use puffin_cache::RepositoryUrl;
|
||||
use puffin_client::RegistryClient;
|
||||
use puffin_distribution::{RemoteDistributionRef, VersionOrUrl};
|
||||
use puffin_normalize::{ExtraName, PackageName};
|
||||
|
@ -923,7 +923,7 @@ impl Locks {
|
|||
/// Acquire a lock on the given resource.
|
||||
async fn acquire(&self, url: &Url) -> Arc<Mutex<()>> {
|
||||
let mut map = self.0.lock().await;
|
||||
map.entry(puffin_cache::digest(&CanonicalUrl::new(url)))
|
||||
map.entry(puffin_cache::digest(&RepositoryUrl::new(url)))
|
||||
.or_insert_with(|| Arc::new(Mutex::new(())))
|
||||
.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue