-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make --no-default-groups
work with --all-groups
#10891
base: main
Are you sure you want to change the base?
Conversation
crates/uv-cli/src/lib.rs
Outdated
#[arg(long, conflicts_with_all = ["only_group", "all_groups"])] | ||
pub group: Vec<GroupName>, |
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 these need to conflict, they're just redundant? (--group foo --all-groups
)
#[arg(long, conflicts_with_all = ["no_group", "only_group"])] | ||
#[arg(long, conflicts_with_all = ["only_group"])] | ||
pub no_default_groups: bool, |
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.
👍 yeah this was wrong
Similarly, I think --only-group
is just redundant? --only-group foo --no-default-groups
doesn't need to error.
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.
The current flag conflicts in groups are inconsistent (for example, --only-dev
should conflict with --group
, but it doesn't). I'd like to address these in a separate PR.
crates/uv-cli/src/lib.rs
Outdated
#[arg(long, conflicts_with_all = ["group", "no_default_groups", "all_groups"])] | ||
pub only_group: Vec<GroupName>, |
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.
Agree this should conflict with --all-groups
38c263e
to
26f70b0
Compare
--no-default-groups
works with --all-groups
--no-default-groups
work with --all-groups
DevMode::Exclude => false, | ||
DevMode::Include | DevMode::Only => group == &*DEV_DEPENDENCIES, | ||
} | ||
} | ||
} |
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.
This method is not used anywhere.
} | ||
} | ||
|
||
/// Returns `true` if the specification includes the given group. | ||
pub fn contains(&self, group: &GroupName) -> bool { | ||
pub fn contains(&self, group: &GroupName, is_default_group: bool) -> bool { |
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.
The is_default_group: bool
argument is not ideal, but it seems to be the simplest solution I could come up with.
Summary
Closes #10890