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:
Charlie Marsh 2024-11-22 16:13:15 -05:00 committed by GitHub
parent 1744a9b0a1
commit 0ae9a8b742
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 246 additions and 23 deletions

View file

@ -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) {