From 6500f7110aca4c86a8b22900b89e03aa0c535240 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 19 Aug 2024 13:43:07 -0500 Subject: [PATCH] Change "any of" to "all of" in error messages (#6222) --- crates/uv-resolver/src/pubgrub/report.rs | 2 +- crates/uv/tests/cache_prune.rs | 2 +- crates/uv/tests/lock.rs | 42 ++++++++++++------------ crates/uv/tests/pip_install.rs | 4 +-- crates/uv/tests/pip_install_scenarios.rs | 6 ++-- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index beba92434800..8ab22e964a48 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -1209,7 +1209,7 @@ impl std::fmt::Display for PackageRange<'_> { if segments.len() > 1 { match self.kind { PackageRangeKind::Dependency => write!(f, "one of:")?, - PackageRangeKind::Compatibility => write!(f, "any of:")?, + PackageRangeKind::Compatibility => write!(f, "all of:")?, PackageRangeKind::Available => write!(f, "are available:")?, } } diff --git a/crates/uv/tests/cache_prune.rs b/crates/uv/tests/cache_prune.rs index 0a935b4e3601..b326a210921e 100644 --- a/crates/uv/tests/cache_prune.rs +++ b/crates/uv/tests/cache_prune.rs @@ -241,7 +241,7 @@ fn prune_unzipped() -> Result<()> { ╰─▶ Because only the following versions of iniconfig are available: iniconfig<=0.1 iniconfig>=1.0.0 - and any of: + and all of: iniconfig<=0.1 iniconfig>=1.0.0 needs to be downloaded from a registry, we can conclude that iniconfig<1.0.0 cannot be used. diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index eb3d487788bf..c529c11f6813 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -2685,28 +2685,28 @@ fn lock_requires_python() -> Result<()> { )?; uv_snapshot!(context.filters(), context.lock(), @r###" - success: false - exit_code: 1 - ----- stdout ----- + success: false + exit_code: 1 + ----- stdout ----- - ----- stderr ----- - warning: `uv lock` is experimental and may change without warning - × No solution found when resolving dependencies: - ╰─▶ 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. - 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 any of: - pygls>=1.1.0,<1.3.0 - pygls>1.3.0 - cannot be used. (1) - - Because the requested Python version (>=3.7) does not satisfy Python>=3.8 and pygls==1.3.0 depends on Python>=3.8, we can conclude that pygls==1.3.0 cannot be used. - And because we know from (1) that any of: - pygls>=1.1.0,<1.3.0 - pygls>1.3.0 - cannot be used, we can conclude that pygls>=1.1.0 cannot be used. - And because your project depends on pygls>=1.1.0, we can conclude that your project's requirements are unsatisfiable. - - hint: The `requires-python` value (>=3.7) includes Python versions that are not supported by your dependencies (e.g., pygls>=1.1.0,<=1.2.1 only supports >=3.7.9, <4). Consider using a more restrictive `requires-python` value (like >=3.7.9, <4). - "###); + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + × No solution found when resolving dependencies: + ╰─▶ 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. + 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 + cannot be used. (1) + + Because the requested Python version (>=3.7) does not satisfy Python>=3.8 and pygls==1.3.0 depends on Python>=3.8, we can conclude that pygls==1.3.0 cannot be used. + And because we know from (1) that all of: + pygls>=1.1.0,<1.3.0 + pygls>1.3.0 + cannot be used, we can conclude that pygls>=1.1.0 cannot be used. + And because your project depends on pygls>=1.1.0, we can conclude that your project's requirements are unsatisfiable. + + hint: The `requires-python` value (>=3.7) includes Python versions that are not supported by your dependencies (e.g., pygls>=1.1.0,<=1.2.1 only supports >=3.7.9, <4). Consider using a more restrictive `requires-python` value (like >=3.7.9, <4). + "###); // Require >=3.7, and allow locking to a version of `pygls` that is compatible (==1.0.1). pyproject_toml.write_str( diff --git a/crates/uv/tests/pip_install.rs b/crates/uv/tests/pip_install.rs index 945bf103efcd..cc75a30a2e4f 100644 --- a/crates/uv/tests/pip_install.rs +++ b/crates/uv/tests/pip_install.rs @@ -1925,13 +1925,13 @@ fn install_only_binary_all_and_no_binary_all() { anyio>=3.0.0,<=3.6.2 anyio>=3.7.0,<=3.7.1 anyio>=4.0.0 - and any of: + and all of: anyio>=1.0.0,<=1.4.0 anyio>=2.0.0,<=2.2.0 anyio>=3.0.0,<=3.6.2 anyio>=3.7.0,<=3.7.1 anyio>=4.0.0 - has no usable wheels and building from source is disabled, we can conclude that any of: + has no usable wheels and building from source is disabled, we can conclude that all of: anyio<1.1.0 anyio>1.4.0,<2.0.0 anyio>2.2.0,<3.0.0 diff --git a/crates/uv/tests/pip_install_scenarios.rs b/crates/uv/tests/pip_install_scenarios.rs index 8f0281d39aae..7669dd9edf7d 100644 --- a/crates/uv/tests/pip_install_scenarios.rs +++ b/crates/uv/tests/pip_install_scenarios.rs @@ -346,7 +346,7 @@ fn excluded_only_compatible_version() { package-a==2.0.0 package-a==3.0.0 and package-a==1.0.0 depends on package-b==1.0.0, we can conclude that package-a<2.0.0 depends on package-b==1.0.0. - And because package-a==3.0.0 depends on package-b==3.0.0, we can conclude that any of: + And because package-a==3.0.0 depends on package-b==3.0.0, we can conclude that all of: package-a<2.0.0 package-a>2.0.0 depend on one of: @@ -3462,7 +3462,7 @@ fn transitive_prerelease_and_stable_dependency_many_versions_holes() { we can conclude that package-a==1.0.0 cannot be used. And because only package-a==1.0.0 is available and you require package-a, we can conclude that your requirements are unsatisfiable. - hint: package-c was requested with a pre-release marker (e.g., any of: + hint: package-c was requested with a pre-release marker (e.g., all of: package-c>1.0.0,<2.0.0a5 package-c>2.0.0a7,<2.0.0b1 package-c>2.0.0b1,<2.0.0b5 @@ -3997,7 +3997,7 @@ fn python_greater_than_current_excluded() { ----- stderr ----- × No solution found when resolving dependencies: - ╰─▶ 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 any of: + ╰─▶ 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.