-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --extra
to uv add
and enable fine grained updates
#4566
Conversation
9d7793f
to
65b723a
Compare
fn update_requirement(old: &mut Requirement, new: Requirement, has_source: bool) { | ||
// Add any new extras. | ||
old.extras.extend(new.extras); | ||
old.extras.dedup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to sort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so? This is updating pyproject.toml
not the lockfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But dedup
only deduplicates adjacent entries, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, fixed. I wonder if extras
should be a HashSet
..
65b723a
to
682939f
Compare
Summary
--extra
flag touv 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 byuv add flask --extra dotenv
preserves the previous version specifier.Resolves #4419.