mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-27 18:36:44 +00:00
Only use relative paths in lockfile (#6490)
For users who were using absolute paths in the `pyproject.toml` previously, this is a behavior change: We now convert all absolute paths in `path` entries to relative paths. Since i assume that no-one relies on absolute path in their lockfiles - they are intended to be portable - I'm tagging this as a bugfix. Closes https://github.com/astral-sh/uv/pull/6438 Fixes https://github.com/astral-sh/uv/issues/6371
This commit is contained in:
parent
611a9003c9
commit
f7835243c5
30 changed files with 329 additions and 383 deletions
|
|
@ -283,26 +283,17 @@ fn required_dist(requirement: &Requirement) -> Result<Option<Dist>, distribution
|
|||
}
|
||||
RequirementSource::Path {
|
||||
install_path,
|
||||
lock_path,
|
||||
ext,
|
||||
url,
|
||||
} => Dist::from_file_url(
|
||||
requirement.name.clone(),
|
||||
url.clone(),
|
||||
install_path,
|
||||
lock_path,
|
||||
*ext,
|
||||
)?,
|
||||
} => Dist::from_file_url(requirement.name.clone(), url.clone(), install_path, *ext)?,
|
||||
RequirementSource::Directory {
|
||||
install_path,
|
||||
lock_path,
|
||||
url,
|
||||
editable,
|
||||
} => Dist::from_directory_url(
|
||||
requirement.name.clone(),
|
||||
url.clone(),
|
||||
install_path,
|
||||
lock_path,
|
||||
*editable,
|
||||
)?,
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ impl<'a, Context: BuildContext> SourceTreeResolver<'a, Context> {
|
|||
let source = SourceUrl::Directory(DirectorySourceUrl {
|
||||
url: &url,
|
||||
install_path: Cow::Borrowed(source_tree),
|
||||
lock_path: Cow::Borrowed(source_tree),
|
||||
editable: false,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ impl<'a, Context: BuildContext> NamedRequirementsResolver<'a, Context> {
|
|||
SourceUrl::Directory(DirectorySourceUrl {
|
||||
url: &requirement.url.verbatim,
|
||||
install_path: Cow::Borrowed(&parsed_directory_url.install_path),
|
||||
lock_path: Cow::Borrowed(&parsed_directory_url.lock_path),
|
||||
editable: parsed_directory_url.editable,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue