mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Use globwalk
for cache-keys
matching (#7337)
## Summary This should be more efficient as we can do a single traversal. Closes https://github.com/astral-sh/uv/issues/7321.
This commit is contained in:
parent
d52af0ccdd
commit
65d53a7474
7 changed files with 74 additions and 77 deletions
|
@ -46,6 +46,8 @@ pub enum Error {
|
|||
CacheEncode(#[from] rmp_serde::encode::Error),
|
||||
#[error("Failed to walk the distribution cache")]
|
||||
CacheWalk(#[source] walkdir::Error),
|
||||
#[error(transparent)]
|
||||
CacheInfo(#[from] uv_cache_info::CacheInfoError),
|
||||
|
||||
// Build error
|
||||
#[error(transparent)]
|
||||
|
|
|
@ -132,8 +132,7 @@ impl<'a> BuiltWheelIndex<'a> {
|
|||
};
|
||||
|
||||
// If the distribution is stale, omit it from the index.
|
||||
let cache_info =
|
||||
CacheInfo::from_directory(&source_dist.install_path).map_err(Error::CacheRead)?;
|
||||
let cache_info = CacheInfo::from_directory(&source_dist.install_path)?;
|
||||
|
||||
if cache_info != *pointer.cache_info() {
|
||||
return Ok(None);
|
||||
|
|
|
@ -1112,8 +1112,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
}
|
||||
|
||||
// Determine the last-modified time of the source distribution.
|
||||
let cache_info =
|
||||
CacheInfo::from_directory(&resource.install_path).map_err(Error::CacheRead)?;
|
||||
let cache_info = CacheInfo::from_directory(&resource.install_path)?;
|
||||
|
||||
// Read the existing metadata from the cache.
|
||||
let entry = cache_shard.entry(LOCAL_REVISION);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue