Skip to content

Commit 4c334e6

Browse files
Show 'depends on itself' for proxy packages (#9717)
1 parent cb03858 commit 4c334e6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

crates/uv-resolver/src/pubgrub/report.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ impl ReportFormatter<PubGrubPackage, Range<Version>, UnavailableReason>
134134
let package_set = self.simplify_set(package_set, package);
135135
let dependency_set = self.simplify_set(dependency_set, dependency);
136136

137-
if package == dependency {
137+
if package.name_no_root() == dependency.name_no_root() {
138138
if let Some(member) = self.format_workspace_member(package) {
139139
return format!(
140140
"{member} depends on itself at an incompatible version ({})",
141-
PackageRange::dependency(package, &dependency_set, None)
141+
PackageRange::dependency(dependency, &dependency_set, None)
142142
);
143143
}
144144
}

crates/uv/tests/it/lock.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19660,7 +19660,7 @@ fn lock_self_extra_to_same_extra_incompatible() -> Result<()> {
1966019660

1966119661
----- stderr -----
1966219662
× No solution found when resolving dependencies:
19663-
╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
19663+
╰─▶ Because project[foo] depends on itself at an incompatible version (project==0.2.0) and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
1966419664

1966519665
hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency.
1966619666
"###);
@@ -19694,7 +19694,7 @@ fn lock_self_extra_to_other_extra_incompatible() -> Result<()> {
1969419694

1969519695
----- stderr -----
1969619696
× No solution found when resolving dependencies:
19697-
╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
19697+
╰─▶ Because project[foo] depends on itself at an incompatible version (project==0.2.0) and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
1969819698

1969919699
hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency.
1970019700
"###);
@@ -19829,7 +19829,7 @@ fn lock_self_extra_incompatible() -> Result<()> {
1982919829

1983019830
----- stderr -----
1983119831
× No solution found when resolving dependencies:
19832-
╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
19832+
╰─▶ Because project[foo] depends on itself at an incompatible version (project==0.2.0) and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable.
1983319833

1983419834
hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency.
1983519835
"###);
@@ -19958,7 +19958,7 @@ fn lock_self_marker_incompatible() -> Result<()> {
1995819958

1995919959
----- stderr -----
1996019960
× No solution found when resolving dependencies:
19961-
╰─▶ Because only project{sys_platform == 'win32'}<=0.1 is available and your project depends on project{sys_platform == 'win32'}>0.1, we can conclude that your project's requirements are unsatisfiable.
19961+
╰─▶ Because only project{sys_platform == 'win32'}<=0.1 is available and your project depends on itself at an incompatible version (project{sys_platform == 'win32'}>0.1), we can conclude that your project's requirements are unsatisfiable.
1996219962

1996319963
hint: The package `project` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency.
1996419964
"###);

0 commit comments

Comments
 (0)