diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index d4d6ae656..b6dbbb34e 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -204,12 +204,8 @@ impl ReportFormatter, UnavailableReason> _ => (), } } - if let [(p, t)] = slice { - if PackageTerm::new(p, t, self).plural() { - result.push_str(" are incompatible"); - } else { - result.push_str(" is incompatible"); - } + if slice.len() == 1 { + result.push_str(" cannot be used"); } else { result.push_str(" are incompatible"); } @@ -1444,22 +1440,6 @@ impl PackageTerm<'_> { formatter, } } - - /// Returns `true` if the predicate following this package term should be singular or plural. - fn plural(&self) -> bool { - match self.term { - Term::Positive(set) => self.formatter.compatible_range(self.package, set).plural(), - Term::Negative(set) => { - if set.as_singleton().is_some() { - false - } else { - self.formatter - .compatible_range(self.package, &set.complement()) - .plural() - } - } - } - } } /// The kind of version ranges being displayed in [`PackageRange`] diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index d1079bbc3..a2420e7af 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -3232,7 +3232,7 @@ fn lock_requires_python() -> Result<()> { ----- stderr ----- × No solution found when resolving dependencies for split (python_full_version >= '3.7' and python_full_version < '3.7.9'): - ╰─▶ Because the requested Python version (>=3.7) does not satisfy Python>=3.8 and the requested Python version (>=3.7) does not satisfy Python>=3.7.9,<3.8, we can conclude that Python>=3.7.9 is incompatible. + ╰─▶ Because the requested Python version (>=3.7) does not satisfy Python>=3.8 and the requested Python version (>=3.7) does not satisfy Python>=3.7.9,<3.8, we can conclude that Python>=3.7.9 cannot be used. And because pygls>=1.1.0,<=1.2.1 depends on Python>=3.7.9,<4 and only pygls<=1.3.0 is available, we can conclude that all of: pygls>=1.1.0,<1.3.0 pygls>1.3.0 diff --git a/crates/uv/tests/it/pip_install_scenarios.rs b/crates/uv/tests/it/pip_install_scenarios.rs index 206d4618f..f34b07611 100644 --- a/crates/uv/tests/it/pip_install_scenarios.rs +++ b/crates/uv/tests/it/pip_install_scenarios.rs @@ -3725,15 +3725,15 @@ fn python_greater_than_current_excluded() { ╰─▶ Because the current Python version (3.9.[X]) does not satisfy Python>=3.10,<3.11 and the current Python version (3.9.[X]) does not satisfy Python>=3.12, we can conclude that all of: Python>=3.10,<3.11 Python>=3.12 - are incompatible. - And because the current Python version (3.9.[X]) does not satisfy Python>=3.11,<3.12, we can conclude that Python>=3.10 is incompatible. + cannot be used. + And because the current Python version (3.9.[X]) does not satisfy Python>=3.11,<3.12, we can conclude that Python>=3.10 cannot be used. And because package-a==2.0.0 depends on Python>=3.10 and only the following versions of package-a are available: package-a<=2.0.0 package-a==3.0.0 package-a==4.0.0 we can conclude that package-a>=2.0.0,<3.0.0 cannot be used. (1) - Because the current Python version (3.9.[X]) does not satisfy Python>=3.11,<3.12 and the current Python version (3.9.[X]) does not satisfy Python>=3.12, we can conclude that Python>=3.11 is incompatible. + Because the current Python version (3.9.[X]) does not satisfy Python>=3.11,<3.12 and the current Python version (3.9.[X]) does not satisfy Python>=3.12, we can conclude that Python>=3.11 cannot be used. And because package-a==3.0.0 depends on Python>=3.11, we can conclude that package-a==3.0.0 cannot be used. And because we know from (1) that package-a>=2.0.0,<3.0.0 cannot be used, we can conclude that package-a>=2.0.0,<4.0.0 cannot be used. (2)