mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Support editable in pip-sync and pip-compile (#587)
Support `-e path/do/dir` in pip-sync and and pip-compile.
This commit is contained in:
parent
f62458f600
commit
f059c6e6a6
47 changed files with 1016 additions and 250 deletions
|
@ -1,5 +1,6 @@
|
|||
use std::borrow::Cow;
|
||||
use std::ops::Deref;
|
||||
use std::path::Path;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use regex::Regex;
|
||||
|
@ -27,6 +28,15 @@ impl VerbatimUrl {
|
|||
})
|
||||
}
|
||||
|
||||
/// Parse a URL from a path.
|
||||
#[allow(clippy::result_unit_err)]
|
||||
pub fn from_path(path: impl AsRef<Path>, given: String) -> Result<Self, ()> {
|
||||
Ok(Self {
|
||||
url: Url::from_directory_path(path)?,
|
||||
given: Some(given),
|
||||
})
|
||||
}
|
||||
|
||||
/// Return the underlying [`Url`].
|
||||
pub fn raw(&self) -> &Url {
|
||||
&self.url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue