mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-21 07:42:05 +00:00
Support extras in editable requirements (#1113)
## Summary This PR adds support for requirements like `-e .[d]`. Closes #1091.
This commit is contained in:
parent
f593b65447
commit
7755f986c3
13 changed files with 248 additions and 37 deletions
|
@ -407,6 +407,22 @@ impl Requirement {
|
|||
}
|
||||
}
|
||||
|
||||
/// A list of [`ExtraName`] that can be attached to a [`Requirement`].
|
||||
#[derive(Debug, Clone, Eq, Hash, PartialEq)]
|
||||
pub struct Extras(Vec<ExtraName>);
|
||||
|
||||
impl Extras {
|
||||
/// Parse a list of extras.
|
||||
pub fn parse(input: &str) -> Result<Self, Pep508Error> {
|
||||
Ok(Self(parse_extras(&mut Cursor::new(input))?))
|
||||
}
|
||||
|
||||
/// Convert the [`Extras`] into a [`Vec`] of [`ExtraName`].
|
||||
pub fn into_vec(self) -> Vec<ExtraName> {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// The actual version specifier or url to install
|
||||
#[derive(Debug, Clone, Eq, Hash, PartialEq)]
|
||||
pub enum VersionOrUrl {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue