mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-17 13:58:29 +00:00
Support workspace to workspace path dependencies (#4833)
Add support for path dependencies from a package in one workspace to a package in another workspace, which it self has workspace dependencies. Say we have a main workspace with packages `a` and `b`, and a second workspace with `c` and `d`. We have `a -> b`, `b -> c`, `c -> d`. This would previously lead to a mangled path for `d`, which is now fixed. Like distribution paths, we split workspace paths into an absolute install path and a relative (or absolute, if the user provided an absolute path) lock path. Part of https://github.com/astral-sh/uv/issues/3943
This commit is contained in:
parent
b5ec859273
commit
abb6ac5127
13 changed files with 410 additions and 88 deletions
|
@ -8,7 +8,7 @@ use regex::Regex;
|
|||
use thiserror::Error;
|
||||
use url::{ParseError, Url};
|
||||
|
||||
use uv_fs::{normalize_path, normalize_url_path};
|
||||
use uv_fs::{normalize_absolute_path, normalize_url_path};
|
||||
|
||||
use crate::Pep508Url;
|
||||
|
||||
|
@ -42,7 +42,7 @@ impl VerbatimUrl {
|
|||
let path = path.as_ref();
|
||||
|
||||
// Normalize the path.
|
||||
let path = normalize_path(path)
|
||||
let path = normalize_absolute_path(path)
|
||||
.map_err(|err| VerbatimUrlError::Normalization(path.to_path_buf(), err))?;
|
||||
|
||||
// Extract the fragment, if it exists.
|
||||
|
@ -83,7 +83,7 @@ impl VerbatimUrl {
|
|||
};
|
||||
|
||||
// Normalize the path.
|
||||
let path = normalize_path(&path)
|
||||
let path = normalize_absolute_path(&path)
|
||||
.map_err(|err| VerbatimUrlError::Normalization(path.clone(), err))?;
|
||||
|
||||
// Extract the fragment, if it exists.
|
||||
|
@ -113,7 +113,7 @@ impl VerbatimUrl {
|
|||
};
|
||||
|
||||
// Normalize the path.
|
||||
let Ok(path) = normalize_path(&path) else {
|
||||
let Ok(path) = normalize_absolute_path(&path) else {
|
||||
return Err(VerbatimUrlError::WorkingDirectory(path));
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue