mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-02 04:48:18 +00:00
Support relative path wheels (#5969)
Surprisingly, this is a lockfile schema change: We can't store relative paths in urls, so we have to store a `filename` entry instead of the whole url. Fixes #4355
This commit is contained in:
parent
dd32087842
commit
fcbee9ce25
10 changed files with 221 additions and 50 deletions
|
|
@ -216,8 +216,12 @@ pub struct DirectUrlBuiltDist {
|
|||
#[derive(Debug, Clone, Hash)]
|
||||
pub struct PathBuiltDist {
|
||||
pub filename: WheelFilename,
|
||||
/// The path to the wheel.
|
||||
pub path: PathBuf,
|
||||
/// The resolved, absolute path to the wheel which we use for installing.
|
||||
pub install_path: PathBuf,
|
||||
/// The absolute path or path relative to the workspace root pointing to the wheel
|
||||
/// which we use for locking. Unlike `given` on the verbatim URL all environment variables
|
||||
/// are resolved, and unlike the install path, we did not yet join it on the base directory.
|
||||
pub lock_path: PathBuf,
|
||||
/// The URL as it was provided by the user.
|
||||
pub url: VerbatimUrl,
|
||||
}
|
||||
|
|
@ -372,7 +376,8 @@ impl Dist {
|
|||
}
|
||||
Ok(Self::Built(BuiltDist::Path(PathBuiltDist {
|
||||
filename,
|
||||
path: canonicalized_path,
|
||||
install_path: canonicalized_path.clone(),
|
||||
lock_path: lock_path.to_path_buf(),
|
||||
url,
|
||||
})))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ impl From<&ResolvedDist> for Requirement {
|
|||
}
|
||||
}
|
||||
Dist::Built(BuiltDist::Path(wheel)) => RequirementSource::Path {
|
||||
install_path: wheel.path.clone(),
|
||||
lock_path: wheel.path.clone(),
|
||||
install_path: wheel.install_path.clone(),
|
||||
lock_path: wheel.lock_path.clone(),
|
||||
url: wheel.url.clone(),
|
||||
ext: DistExtension::Wheel,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue