mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 11:07:59 +00:00
Remove verbatim URL from path file location (#998)
## Summary I got confused by why `VerbatimUrl` was on `Path`. Since it's directly computed from it, I think we should just compute it as-needed. I think it's also possibly-buggy because the URL is the URL of the _directory_, not the artifact itself, which differs from other distributions.
This commit is contained in:
parent
6af4eb7a45
commit
9b24fcd306
6 changed files with 19 additions and 17 deletions
|
|
@ -20,6 +20,7 @@ use distribution_types::{
|
|||
Name, PathSourceDist, RemoteSource, SourceDist,
|
||||
};
|
||||
use install_wheel_rs::read_dist_info;
|
||||
use pep508_rs::VerbatimUrl;
|
||||
use platform_tags::Tags;
|
||||
use puffin_cache::{CacheBucket, CacheEntry, CacheShard, CachedByTimestamp, WheelCache};
|
||||
use puffin_client::{CachedClient, CachedClientError, DataWithCachePolicy};
|
||||
|
|
@ -104,10 +105,12 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
|||
.map_err(|err| SourceDistError::UrlParse(url.clone(), err))?,
|
||||
FileLocation::AbsoluteUrl(url) => Url::parse(url)
|
||||
.map_err(|err| SourceDistError::UrlParse(url.clone(), err))?,
|
||||
FileLocation::Path(path, url) => {
|
||||
FileLocation::Path(path) => {
|
||||
let path_source_dist = PathSourceDist {
|
||||
name: registry_source_dist.filename.name.clone(),
|
||||
url: url.clone(),
|
||||
url: VerbatimUrl::unknown(
|
||||
Url::from_file_path(path).expect("path is absolute"),
|
||||
),
|
||||
path: path.clone(),
|
||||
editable: false,
|
||||
};
|
||||
|
|
@ -177,10 +180,12 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
|||
.map_err(|err| SourceDistError::UrlParse(url.clone(), err))?,
|
||||
FileLocation::AbsoluteUrl(url) => Url::parse(url)
|
||||
.map_err(|err| SourceDistError::UrlParse(url.clone(), err))?,
|
||||
FileLocation::Path(path, url) => {
|
||||
FileLocation::Path(path) => {
|
||||
let path_source_dist = PathSourceDist {
|
||||
name: registry_source_dist.filename.name.clone(),
|
||||
url: url.clone(),
|
||||
url: VerbatimUrl::unknown(
|
||||
Url::from_file_path(path).expect("path is absolute"),
|
||||
),
|
||||
path: path.clone(),
|
||||
editable: false,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue