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:
konsti 2024-08-09 23:57:16 +02:00 committed by GitHub
parent dd32087842
commit fcbee9ce25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 221 additions and 50 deletions

View file

@ -330,13 +330,14 @@ impl<'a> Planner<'a> {
let wheel = PathBuiltDist {
filename,
url: url.clone(),
path,
install_path: install_path.clone(),
lock_path: lock_path.clone(),
};
if !wheel.filename.is_compatible(tags) {
bail!(
"A path dependency is incompatible with the current platform: {}",
wheel.path.user_display()
wheel.lock_path.user_display()
);
}
@ -357,7 +358,7 @@ impl<'a> Planner<'a> {
.entry(format!("{}.rev", wheel.filename.stem()));
if let Some(pointer) = LocalArchivePointer::read_from(&cache_entry)? {
let timestamp = ArchiveTimestamp::from_file(&wheel.path)?;
let timestamp = ArchiveTimestamp::from_file(&wheel.install_path)?;
if pointer.is_up_to_date(timestamp) {
let archive = pointer.into_archive();
if archive.satisfies(hasher.get(&wheel)) {