mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Add --extra
to uv add
and enable fine grained updates (#4566)
## Summary - Adds a `--extra` flag to `uv add` that allows activating extras without the PEP508 syntax. - `uv add` now errors if the update is ambiguous (e.g. the dependency is present twice with different markers) - `uv add` is smarter about updates. For example, `uv add flask==3.0.0` followed by `uv add flask --extra dotenv` preserves the previous version specifier. Resolves https://github.com/astral-sh/uv/issues/4419.
This commit is contained in:
parent
95b4aacc25
commit
a8c28c4612
6 changed files with 331 additions and 68 deletions
|
@ -1771,6 +1771,10 @@ pub struct AddArgs {
|
|||
#[arg(long)]
|
||||
pub branch: Option<String>,
|
||||
|
||||
/// Extras to activate for the dependency; may be provided more than once.
|
||||
#[arg(long)]
|
||||
pub extra: Option<Vec<ExtraName>>,
|
||||
|
||||
#[command(flatten)]
|
||||
pub installer: ResolverInstallerArgs,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue