mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Use archive_mtime
in another call site (#1056)
_Not_ using this was an oversight.
This commit is contained in:
parent
9fd3b8298d
commit
81401a17e5
1 changed files with 2 additions and 24 deletions
|
@ -537,30 +537,8 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
|||
);
|
||||
|
||||
// Determine the last-modified time of the source distribution.
|
||||
let file_metadata = fs_err::metadata(&path_source_dist.path)?;
|
||||
let modified = if file_metadata.is_file() {
|
||||
// `modified()` is infallible on windows and unix (i.e., all platforms we support).
|
||||
file_metadata.modified()?
|
||||
} else {
|
||||
if let Some(metadata) = path_source_dist
|
||||
.path
|
||||
.join("pyproject.toml")
|
||||
.metadata()
|
||||
.ok()
|
||||
.filter(std::fs::Metadata::is_file)
|
||||
{
|
||||
metadata.modified()?
|
||||
} else if let Some(metadata) = path_source_dist
|
||||
.path
|
||||
.join("setup.py")
|
||||
.metadata()
|
||||
.ok()
|
||||
.filter(std::fs::Metadata::is_file)
|
||||
{
|
||||
metadata.modified()?
|
||||
} else {
|
||||
return Err(SourceDistError::DirWithoutEntrypoint);
|
||||
}
|
||||
let Some(modified) = puffin_cache::archive_mtime(&path_source_dist.path)? else {
|
||||
return Err(SourceDistError::DirWithoutEntrypoint);
|
||||
};
|
||||
|
||||
// Read the existing metadata from the cache.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue