mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-24 17:16:02 +00:00
Remove FileLocation::Path variant (#6577)
## Summary This is redundant now that we support `file://` URLs.
This commit is contained in:
parent
2f94422484
commit
1eb97c91fd
7 changed files with 7 additions and 64 deletions
|
|
@ -100,24 +100,6 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
pypi_types::base_url_join_relative(base, url)?
|
||||
}
|
||||
FileLocation::AbsoluteUrl(url) => url.to_url(),
|
||||
FileLocation::Path(path) => {
|
||||
let url = Url::from_file_path(path)
|
||||
.map_err(|()| Error::RelativePath(path.clone()))?;
|
||||
return self
|
||||
.archive(
|
||||
source,
|
||||
&PathSourceUrl {
|
||||
url: &url,
|
||||
path: Cow::Borrowed(path),
|
||||
ext: dist.ext,
|
||||
},
|
||||
&cache_shard,
|
||||
tags,
|
||||
hashes,
|
||||
)
|
||||
.boxed_local()
|
||||
.await;
|
||||
}
|
||||
};
|
||||
|
||||
// If the URL is a file URL, use the local path directly.
|
||||
|
|
@ -277,23 +259,6 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
pypi_types::base_url_join_relative(base, url)?
|
||||
}
|
||||
FileLocation::AbsoluteUrl(url) => url.to_url(),
|
||||
FileLocation::Path(path) => {
|
||||
let url = Url::from_file_path(path)
|
||||
.map_err(|()| Error::RelativePath(path.clone()))?;
|
||||
return self
|
||||
.archive_metadata(
|
||||
source,
|
||||
&PathSourceUrl {
|
||||
url: &url,
|
||||
path: Cow::Borrowed(path),
|
||||
ext: dist.ext,
|
||||
},
|
||||
&cache_shard,
|
||||
hashes,
|
||||
)
|
||||
.boxed_local()
|
||||
.await;
|
||||
}
|
||||
};
|
||||
|
||||
// If the URL is a file URL, use the local path directly.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue