mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-17 13:58:29 +00:00
Annotate default groups in conflict error messages (#9368)
## Summary We now tell the user if a group was enabled by default. Closes https://github.com/astral-sh/uv/issues/9366.
This commit is contained in:
parent
1744a9b0a1
commit
0ae9a8b742
3 changed files with 246 additions and 23 deletions
|
@ -346,6 +346,18 @@ impl DevGroupsManifest {
|
|||
self.spec.prod()
|
||||
}
|
||||
|
||||
/// Returns `true` if the group was enabled by default.
|
||||
pub fn default(&self, group: &GroupName) -> bool {
|
||||
if self.spec.contains(group) {
|
||||
// If the group was explicitly requested, then it wasn't enabled by default.
|
||||
false
|
||||
} else {
|
||||
// If the group was enabled, but wasn't explicitly requested, then it was enabled by
|
||||
// default.
|
||||
self.contains(group)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the group is included in the manifest.
|
||||
pub fn contains(&self, group: &GroupName) -> bool {
|
||||
if self.spec.contains(group) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue