diff --git a/crates/uv-pypi-types/src/conflicts.rs b/crates/uv-pypi-types/src/conflicts.rs index 2ce6f35e8ed6d..8834967c95040 100644 --- a/crates/uv-pypi-types/src/conflicts.rs +++ b/crates/uv-pypi-types/src/conflicts.rs @@ -217,12 +217,23 @@ impl Conflicts { /// /// A `TryFrom>` impl may be used to build a set from a /// sequence. Note though that at least 2 items are required. -#[derive(Debug, Default, Clone, Hash, Eq, PartialEq)] +#[derive(Debug, Default, Clone, Hash)] pub struct ConflictSet { set: BTreeSet, + /// Whether this conflict set was inferred from transitively included items. + /// + /// Note this field is _not_ included in equality checks. is_inferred_conflict: bool, } +impl PartialEq for ConflictSet { + fn eq(&self, other: &Self) -> bool { + self.set == other.set + } +} + +impl Eq for ConflictSet {} + impl ConflictSet { /// Create a pair of items that conflict with one another. pub fn pair(item1: ConflictItem, item2: ConflictItem) -> Self { diff --git a/crates/uv/tests/it/sync.rs b/crates/uv/tests/it/sync.rs index 40ce60eb93a3a..7795c11d66af3 100644 --- a/crates/uv/tests/it/sync.rs +++ b/crates/uv/tests/it/sync.rs @@ -10986,6 +10986,24 @@ fn transitive_group_conflicts_shallow() -> Result<()> { "#, )?; + uv_snapshot!(context.filters(), context.lock(), @r" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved 5 packages in [TIME] + "); + + uv_snapshot!(context.filters(), context.lock().arg("--check"), @r" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved 5 packages in [TIME] + "); + uv_snapshot!(context.filters(), context.sync(), @r" success: true exit_code: 0 @@ -11037,7 +11055,7 @@ fn transitive_group_conflicts_shallow() -> Result<()> { ----- stderr ----- Resolved 5 packages in [TIME] - error: Groups `dev` and `magic` are incompatible with the transitively inferred conflicts: {`example:dev`, `example:magic`} + error: Groups `dev` and `magic` are incompatible with the declared conflicts: {`example:dev`, `example:magic`} "); Ok(())