DEMO: Include the installed version in the message

This commit is contained in:
Zanie 2024-01-21 19:44:17 -06:00
parent 044c354647
commit 43910a8e9a
3 changed files with 12 additions and 11 deletions

View file

@ -53,8 +53,9 @@ impl ReportFormatter<PubGrubPackage, Range<Version>> for PubGrubReportFormatter<
// Determine which Python version requirement was not met
if !set.contains(python.target()) {
return format!(
"the requested {package} version ({}) does not satisfy {}",
"the requested {package} version ({}, {} installed) does not satisfy {}",
python.target(),
python.installed(),
PackageRange::compatibility(package, set)
);
}

View file

@ -687,9 +687,9 @@ fn compile_python_37() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
Because the requested Python version (3.7.17) does not satisfy
Python>=3.8 and black==23.10.1 depends on Python>=3.8, we can conclude
that black==23.10.1 cannot be used.
Because the requested Python version (3.7.17, 3.12.0 installed) does not
satisfy Python>=3.8 and black==23.10.1 depends on Python>=3.8, we can
conclude that black==23.10.1 cannot be used.
And because you require black==23.10.1 we can conclude that the
requirements are unsatisfiable.
"###);

View file

@ -2554,7 +2554,7 @@ fn requires_python_version_does_not_exist() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
Because the requested Python version (3.7) does not satisfy Python>=4.0 and albatross==1.0.0 depends on Python>=4.0, we can conclude that albatross==1.0.0 cannot be used.
Because the requested Python version (3.7, 3.7.17 installed) does not satisfy Python>=4.0 and albatross==1.0.0 depends on Python>=4.0, we can conclude that albatross==1.0.0 cannot be used.
And because you require albatross==1.0.0 we can conclude that the requirements are unsatisfiable.
"###);
});
@ -2611,7 +2611,7 @@ fn requires_python_version_less_than_current() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
Because the requested Python version (3.9) does not satisfy Python<=3.8 and albatross==1.0.0 depends on Python<=3.8, we can conclude that albatross==1.0.0 cannot be used.
Because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python<=3.8 and albatross==1.0.0 depends on Python<=3.8, we can conclude that albatross==1.0.0 cannot be used.
And because you require albatross==1.0.0 we can conclude that the requirements are unsatisfiable.
"###);
});
@ -2668,7 +2668,7 @@ fn requires_python_version_greater_than_current() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
Because the requested Python version (3.9) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used.
Because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used.
And because you require albatross==1.0.0 we can conclude that the requirements are unsatisfiable.
"###);
});
@ -2876,22 +2876,22 @@ fn requires_python_version_greater_than_current_excluded() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
Because the requested Python version (3.9) does not satisfy Python>=3.10,<3.11 and the requested Python version (3.9) does not satisfy Python>=3.12, we can conclude that any of:
Because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.10,<3.11 and the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.12, we can conclude that any of:
Python>=3.10,<3.11
Python>=3.12
are incompatible.
And because the requested Python version (3.9) does not satisfy Python>=3.11,<3.12 we can conclude that Python>=3.10 are incompatible.
And because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.11,<3.12 we can conclude that Python>=3.10 are incompatible.
And because albatross==2.0.0 depends on Python>=3.10 and there are no versions of albatross that satisfy any of:
albatross>2.0.0,<3.0.0
albatross>3.0.0,<4.0.0
albatross>4.0.0
we can conclude that albatross>=2.0.0,<3.0.0 cannot be used. (1)
Because the requested Python version (3.9) does not satisfy Python>=3.11,<3.12 and the requested Python version (3.9) does not satisfy Python>=3.12, we can conclude that Python>=3.11 are incompatible.
Because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.11,<3.12 and the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.12, we can conclude that Python>=3.11 are incompatible.
And because albatross==3.0.0 depends on Python>=3.11 we can conclude that albatross==3.0.0 cannot be used.
And because we know from (1) that albatross>=2.0.0,<3.0.0 cannot be used, we can conclude that albatross>=2.0.0,<4.0.0 cannot be used. (2)
Because the requested Python version (3.9) does not satisfy Python>=3.12 and albatross==4.0.0 depends on Python>=3.12, we can conclude that albatross==4.0.0 cannot be used.
Because the requested Python version (3.9, 3.9.17 installed) does not satisfy Python>=3.12 and albatross==4.0.0 depends on Python>=3.12, we can conclude that albatross==4.0.0 cannot be used.
And because we know from (2) that albatross>=2.0.0,<4.0.0 cannot be used, we can conclude that albatross>=2.0.0 cannot be used.
And because you require albatross>=2.0.0 we can conclude that the requirements are unsatisfiable.
"###);