mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #9124 from pradyunsg/nicer-error-message-wording
Update message displayed on conflicts post-resolution
This commit is contained in:
commit
15871707f6
2 changed files with 11 additions and 8 deletions
|
@ -529,14 +529,16 @@ class InstallCommand(RequirementCommand):
|
||||||
parts = [] # type: List[str]
|
parts = [] # type: List[str]
|
||||||
if resolver_variant == "legacy":
|
if resolver_variant == "legacy":
|
||||||
parts.append(
|
parts.append(
|
||||||
"After October 2020 you may experience errors when installing "
|
"pip's legacy dependency resolver does not consider dependency "
|
||||||
"or updating packages. This is because pip will change the "
|
"conflicts when selecting packages. This behaviour is the "
|
||||||
"way that it resolves dependency conflicts.\n"
|
"source of the following dependency conflicts."
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
assert resolver_variant == "2020-resolver"
|
||||||
parts.append(
|
parts.append(
|
||||||
"We recommend you use --use-feature=2020-resolver to test "
|
"pip's dependency resolver does not currently take into account "
|
||||||
"your packages with the new resolver before it becomes the "
|
"all the packages that are installed. This behaviour is the "
|
||||||
"default.\n"
|
"source of the following dependency conflicts."
|
||||||
)
|
)
|
||||||
|
|
||||||
# NOTE: There is some duplication here, with commands/check.py
|
# NOTE: There is some duplication here, with commands/check.py
|
||||||
|
@ -557,7 +559,7 @@ class InstallCommand(RequirementCommand):
|
||||||
version = package_set[project_name][0]
|
version = package_set[project_name][0]
|
||||||
for dep_name, dep_version, req in conflicting[project_name]:
|
for dep_name, dep_version, req in conflicting[project_name]:
|
||||||
message = (
|
message = (
|
||||||
"{name} {version} requires {requirement}, but you'll have "
|
"{name} {version} requires {requirement}, but {you} have "
|
||||||
"{dep_name} {dep_version} which is incompatible."
|
"{dep_name} {dep_version} which is incompatible."
|
||||||
).format(
|
).format(
|
||||||
name=project_name,
|
name=project_name,
|
||||||
|
@ -565,6 +567,7 @@ class InstallCommand(RequirementCommand):
|
||||||
requirement=req,
|
requirement=req,
|
||||||
dep_name=dep_name,
|
dep_name=dep_name,
|
||||||
dep_version=dep_version,
|
dep_version=dep_version,
|
||||||
|
you=("you" if resolver_variant == "2020-resolver" else "you'll")
|
||||||
)
|
)
|
||||||
parts.append(message)
|
parts.append(message)
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ def test_check_install_does_not_warn_for_out_of_graph_issues(script):
|
||||||
assert_contains_expected_lines(result.stderr, [
|
assert_contains_expected_lines(result.stderr, [
|
||||||
"broken 1.0 requires missing, which is not installed.",
|
"broken 1.0 requires missing, which is not installed.",
|
||||||
"broken 1.0 requires conflict<1.0, "
|
"broken 1.0 requires conflict<1.0, "
|
||||||
"but you'll have conflict 1.0 which is incompatible."
|
"but you have conflict 1.0 which is incompatible."
|
||||||
])
|
])
|
||||||
|
|
||||||
# Install unrelated package
|
# Install unrelated package
|
||||||
|
|
Loading…
Reference in a new issue