mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-02 04:48:18 +00:00
Create dedicated abstractions for .rev and .http pointers (#2977)
## Summary This PR formalizes some of the concepts we use in the cache for "pointers to things". In the wheel cache, we have files like `annotated_types-0.6.0-py3-none-any.http`. This represents an unzipped wheel, cached alongside an HTTP caching policy. We now have a struct for this to encapsulate the logic: `HttpArchivePointer`. Similarly, we have files like `annotated_types-0.6.0-py3-none-any.rev`. This represents an unzipped local wheel, alongside with a timestamp. We now have a struct for this to encapsulate the logic: `LocalArchivePointer`. We have similar structs for source distributions too.
This commit is contained in:
parent
006379c50c
commit
5583b90c30
8 changed files with 249 additions and 169 deletions
|
|
@ -71,6 +71,12 @@ impl CacheEntry {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<Path> for CacheEntry {
|
||||
fn as_ref(&self) -> &Path {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// A subdirectory within the cache.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CacheShard(PathBuf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue