Skip to content

Commit 181bfe6

Browse files
committed
*: update "conflicting groups" terminology everywhere else
1 parent b87bce4 commit 181bfe6

28 files changed

+134
-142
lines changed

crates/uv-bench/benches/uv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ mod resolver {
163163
let options = OptionsBuilder::new().exclude_newer(exclude_newer).build();
164164
let sources = SourceStrategy::default();
165165
let dependency_metadata = DependencyMetadata::default();
166-
let conflicting_groups = Conflicts::empty();
166+
let conflicts = Conflicts::empty();
167167

168168
let python_requirement = if universal {
169169
PythonRequirement::from_requires_python(
@@ -209,7 +209,7 @@ mod resolver {
209209
options,
210210
&python_requirement,
211211
markers,
212-
conflicting_groups,
212+
conflicts,
213213
Some(&TAGS),
214214
&flat_index,
215215
&index,

crates/uv-pypi-types/src/conflicts.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use uv_normalize::{ExtraName, PackageName};
22

3-
/// A list of conflicting groups pre-defined by an end user.
3+
/// A list of conflicting sets of extras/groups pre-defined by an end user.
44
///
55
/// This is useful to force the resolver to fork according to extras that have
66
/// unavoidable conflicts with each other. (The alternative is that resolution
@@ -11,7 +11,7 @@ use uv_normalize::{ExtraName, PackageName};
1111
pub struct Conflicts(Vec<ConflictSet>);
1212

1313
impl Conflicts {
14-
/// Returns no conflicting groups.
14+
/// Returns no conflicts.
1515
///
1616
/// This results in no effect on resolution.
1717
pub fn empty() -> Conflicts {
@@ -31,7 +31,7 @@ impl Conflicts {
3131
/// Returns true if these conflicts contain any set that contains the given
3232
/// package and extra name pair.
3333
pub fn contains(&self, package: &PackageName, extra: &ExtraName) -> bool {
34-
self.iter().any(|groups| groups.contains(package, extra))
34+
self.iter().any(|set| set.contains(package, extra))
3535
}
3636

3737
/// Returns true if there are no conflicts.
@@ -78,7 +78,7 @@ impl ConflictSet {
7878
/// extra name pair.
7979
pub fn contains(&self, package: &PackageName, extra: &ExtraName) -> bool {
8080
self.iter()
81-
.any(|group| group.package() == package && group.extra() == extra)
81+
.any(|set| set.package() == package && set.extra() == extra)
8282
}
8383
}
8484

@@ -87,8 +87,8 @@ impl<'de> serde::Deserialize<'de> for ConflictSet {
8787
where
8888
D: serde::Deserializer<'de>,
8989
{
90-
let groups = Vec::<ConflictItem>::deserialize(deserializer)?;
91-
Self::try_from(groups).map_err(serde::de::Error::custom)
90+
let set = Vec::<ConflictItem>::deserialize(deserializer)?;
91+
Self::try_from(set).map_err(serde::de::Error::custom)
9292
}
9393
}
9494

@@ -193,10 +193,10 @@ impl<'a> From<(&'a PackageName, &'a ExtraName)> for ConflictItemRef<'a> {
193193
#[derive(Debug, thiserror::Error)]
194194
pub enum ConflictError {
195195
/// An error for when there are zero conflicting items.
196-
#[error("Each set of conflicting groups must have at least two entries, but found none")]
196+
#[error("Each set of conflicts must have at least two entries, but found none")]
197197
ZeroItems,
198198
/// An error for when there is one conflicting items.
199-
#[error("Each set of conflicting groups must have at least two entries, but found only one")]
199+
#[error("Each set of conflicts must have at least two entries, but found only one")]
200200
OneItem,
201201
}
202202

@@ -222,7 +222,7 @@ impl SchemaConflicts {
222222
/// If a conflict has an explicit package name (written by the end user),
223223
/// then that takes precedence over the given package name, which is only
224224
/// used when there is no explicit package name written.
225-
pub fn to_conflicting_with_package_name(&self, package: &PackageName) -> Conflicts {
225+
pub fn to_conflicts_with_package_name(&self, package: &PackageName) -> Conflicts {
226226
let mut conflicting = Conflicts::empty();
227227
for tool_uv_set in &self.0 {
228228
let mut set = vec![];

crates/uv-resolver/src/lock/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub struct Lock {
8282
/// forks in the lockfile so we can recreate them in subsequent resolutions.
8383
fork_markers: Vec<MarkerTree>,
8484
/// The conflicting groups/extras specified by the user.
85-
conflicting_groups: Conflicts,
85+
conflicts: Conflicts,
8686
/// The list of supported environments specified by the user.
8787
supported_environments: Vec<MarkerTree>,
8888
/// The range of supported Python versions.
@@ -315,7 +315,7 @@ impl Lock {
315315
requires_python: RequiresPython,
316316
options: ResolverOptions,
317317
manifest: ResolverManifest,
318-
conflicting_groups: Conflicts,
318+
conflicts: Conflicts,
319319
supported_environments: Vec<MarkerTree>,
320320
fork_markers: Vec<MarkerTree>,
321321
) -> Result<Self, LockError> {
@@ -465,7 +465,7 @@ impl Lock {
465465
let lock = Self {
466466
version,
467467
fork_markers,
468-
conflicting_groups,
468+
conflicts,
469469
supported_environments,
470470
requires_python,
471471
options,
@@ -485,8 +485,8 @@ impl Lock {
485485

486486
/// Record the conflicting groups that were used to generate this lock.
487487
#[must_use]
488-
pub fn with_conflicting_groups(mut self, conflicting_groups: Conflicts) -> Self {
489-
self.conflicting_groups = conflicting_groups;
488+
pub fn with_conflicts(mut self, conflicts: Conflicts) -> Self {
489+
self.conflicts = conflicts;
490490
self
491491
}
492492

@@ -550,8 +550,8 @@ impl Lock {
550550
}
551551

552552
/// Returns the conflicting groups that were used to generate this lock.
553-
pub fn conflicting_groups(&self) -> &Conflicts {
554-
&self.conflicting_groups
553+
pub fn conflicts(&self) -> &Conflicts {
554+
&self.conflicts
555555
}
556556

557557
/// Returns the supported environments that were used to generate this lock.
@@ -632,17 +632,17 @@ impl Lock {
632632
doc.insert("supported-markers", value(supported_environments));
633633
}
634634

635-
if !self.conflicting_groups.is_empty() {
635+
if !self.conflicts.is_empty() {
636636
let mut list = Array::new();
637-
for groups in self.conflicting_groups.iter() {
637+
for groups in self.conflicts.iter() {
638638
list.push(each_element_on_its_line_array(groups.iter().map(|group| {
639639
let mut table = InlineTable::new();
640640
table.insert("package", Value::from(group.package().to_string()));
641641
table.insert("extra", Value::from(group.extra().to_string()));
642642
table
643643
})));
644644
}
645-
doc.insert("conflicting-groups", value(list));
645+
doc.insert("conflicts", value(list));
646646
}
647647

648648
// Write the settings that were used to generate the resolution.
@@ -1383,8 +1383,8 @@ struct LockWire {
13831383
fork_markers: Vec<SimplifiedMarkerTree>,
13841384
#[serde(rename = "supported-markers", default)]
13851385
supported_environments: Vec<SimplifiedMarkerTree>,
1386-
#[serde(rename = "conflicting-groups", default)]
1387-
conflicting_groups: Option<Conflicts>,
1386+
#[serde(rename = "conflicts", default)]
1387+
conflicts: Option<Conflicts>,
13881388
/// We discard the lockfile if these options match.
13891389
#[serde(default)]
13901390
options: ResolverOptions,
@@ -1436,7 +1436,7 @@ impl TryFrom<LockWire> for Lock {
14361436
wire.requires_python,
14371437
wire.options,
14381438
wire.manifest,
1439-
wire.conflicting_groups.unwrap_or_else(Conflicts::empty),
1439+
wire.conflicts.unwrap_or_else(Conflicts::empty),
14401440
supported_environments,
14411441
fork_markers,
14421442
)?;

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__hash_optional_missing.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__hash_optional_present.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__hash_required_present.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__missing_dependency_source_unambiguous.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__missing_dependency_source_version_unambiguous.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__missing_dependency_version_unambiguous.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

crates/uv-resolver/src/lock/snapshots/uv_resolver__lock__tests__source_direct_has_subdir.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ok(
66
Lock {
77
version: 1,
88
fork_markers: [],
9-
conflicting_groups: ConflictingGroupList(
9+
conflicts: Conflicts(
1010
[],
1111
),
1212
supported_environments: [],

0 commit comments

Comments
 (0)