diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index 8aa8d0dc6723..4774abef3ffa 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -523,7 +523,7 @@ impl PubGrubReportFormatter<'_> { reason: reason.clone(), }); } - Some(UnavailablePackage::NotFound) => {} + Some(UnavailablePackage::NotFound | UnavailablePackage::WorkspaceMember) => {} None => {} } diff --git a/crates/uv-resolver/src/resolver/availability.rs b/crates/uv-resolver/src/resolver/availability.rs index 1b01cb25f5da..f40dfe499190 100644 --- a/crates/uv-resolver/src/resolver/availability.rs +++ b/crates/uv-resolver/src/resolver/availability.rs @@ -74,6 +74,8 @@ pub(crate) enum UnavailablePackage { InvalidMetadata(String), /// The package has an invalid structure. InvalidStructure(String), + /// No other versions of the package can be used because it is a workspace member + WorkspaceMember, } impl UnavailablePackage { @@ -85,6 +87,7 @@ impl UnavailablePackage { UnavailablePackage::MissingMetadata => "does not include a `METADATA` file", UnavailablePackage::InvalidMetadata(_) => "has invalid metadata", UnavailablePackage::InvalidStructure(_) => "has an invalid package format", + UnavailablePackage::WorkspaceMember => "is a workspace member", } } } diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 5ea70ac15272..52bdd861e404 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -451,8 +451,23 @@ impl ResolverState Result<()> { Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because only httpx<=9999 is available and leaf==0.1.0 depends on httpx>9999, we can conclude that leaf==0.1.0 cannot be used. - And because only leaf==0.1.0 is available and you require leaf, we can conclude that the requirements are unsatisfiable. + And because leaf is a workspace member and you require leaf, we can conclude that the requirements are unsatisfiable. "### ); @@ -1256,8 +1256,8 @@ fn workspace_unsatisfiable_member_dependencies_conflicting() -> Result<()> { ----- stderr ----- Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: - ╰─▶ Because only bar==0.1.0 is available and bar==0.1.0 depends on anyio==4.2.0, we can conclude that all versions of bar depend on anyio==4.2.0. - And because foo==0.1.0 depends on anyio==4.1.0 and only foo==0.1.0 is available, we can conclude that all versions of bar and all versions of foo are incompatible. + ╰─▶ Because bar is a workspace member and bar==0.1.0 depends on anyio==4.2.0, we can conclude that all versions of bar depend on anyio==4.2.0. + And because foo==0.1.0 depends on anyio==4.1.0 and foo is a workspace member, we can conclude that all versions of bar and all versions of foo are incompatible. And because you require bar and foo, we can conclude that the requirements are unsatisfiable. "### ); @@ -1324,8 +1324,8 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_threeway() -> Result< ----- stderr ----- Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: - ╰─▶ Because only bird==0.1.0 is available and bird==0.1.0 depends on anyio==4.3.0, we can conclude that all versions of bird depend on anyio==4.3.0. - And because knot==0.1.0 depends on anyio==4.2.0 and only knot==0.1.0 is available, we can conclude that all versions of bird and all versions of knot are incompatible. + ╰─▶ Because bird is a workspace member and bird==0.1.0 depends on anyio==4.3.0, we can conclude that all versions of bird depend on anyio==4.3.0. + And because knot==0.1.0 depends on anyio==4.2.0 and knot is a workspace member, we can conclude that all versions of bird and all versions of knot are incompatible. And because you require bird and knot, we can conclude that the requirements are unsatisfiable. "### );