diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index 3b86ccfcb..8a418351a 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -134,11 +134,11 @@ impl ReportFormatter, UnavailableReason> let package_set = self.simplify_set(package_set, package); let dependency_set = self.simplify_set(dependency_set, dependency); - if package == dependency { + if package.name_no_root() == dependency.name_no_root() { if let Some(member) = self.format_workspace_member(package) { return format!( "{member} depends on itself at an incompatible version ({})", - PackageRange::dependency(package, &dependency_set, None) + PackageRange::dependency(dependency, &dependency_set, None) ); } } diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index 5629ef9ca..ad7552c6a 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -19660,7 +19660,7 @@ fn lock_self_extra_to_same_extra_incompatible() -> Result<()> { ----- stderr ----- × No solution found when resolving dependencies: - ╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable. + ╰─▶ 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. hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency. "###); @@ -19694,7 +19694,7 @@ fn lock_self_extra_to_other_extra_incompatible() -> Result<()> { ----- stderr ----- × No solution found when resolving dependencies: - ╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable. + ╰─▶ 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. hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency. "###); @@ -19829,7 +19829,7 @@ fn lock_self_extra_incompatible() -> Result<()> { ----- stderr ----- × No solution found when resolving dependencies: - ╰─▶ Because project[foo] depends on your project and your project requires project[foo], we can conclude that your project's requirements are unsatisfiable. + ╰─▶ 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. hint: The package `project[foo]` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency. "###); @@ -19958,7 +19958,7 @@ fn lock_self_marker_incompatible() -> Result<()> { ----- stderr ----- × No solution found when resolving dependencies: - ╰─▶ 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. + ╰─▶ 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. hint: The package `project` depends on itself at an incompatible version. This is likely a mistake. Consider removing the dependency. "###);