Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "any of" to "all of" in error messages #6222

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/uv-resolver/src/pubgrub/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:")?,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/cache_prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 21 additions & 21 deletions crates/uv/tests/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions crates/uv/tests/pip_install_scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Loading