未验证 提交 15871707 编写于 作者: P Pradyun Gedam 提交者: GitHub

Merge pull request #9124 from pradyunsg/nicer-error-message-wording

Update message displayed on conflicts post-resolution
......@@ -529,14 +529,16 @@ class InstallCommand(RequirementCommand):
parts = [] # type: List[str]
if resolver_variant == "legacy":
parts.append(
"After October 2020 you may experience errors when installing "
"or updating packages. This is because pip will change the "
"way that it resolves dependency conflicts.\n"
"pip's legacy dependency resolver does not consider dependency "
"conflicts when selecting packages. This behaviour is the "
"source of the following dependency conflicts."
)
else:
assert resolver_variant == "2020-resolver"
parts.append(
"We recommend you use --use-feature=2020-resolver to test "
"your packages with the new resolver before it becomes the "
"default.\n"
"pip's dependency resolver does not currently take into account "
"all the packages that are installed. This behaviour is the "
"source of the following dependency conflicts."
)
# NOTE: There is some duplication here, with commands/check.py
......@@ -557,7 +559,7 @@ class InstallCommand(RequirementCommand):
version = package_set[project_name][0]
for dep_name, dep_version, req in conflicting[project_name]:
message = (
"{name} {version} requires {requirement}, but you'll have "
"{name} {version} requires {requirement}, but {you} have "
"{dep_name} {dep_version} which is incompatible."
).format(
name=project_name,
......@@ -565,6 +567,7 @@ class InstallCommand(RequirementCommand):
requirement=req,
dep_name=dep_name,
dep_version=dep_version,
you=("you" if resolver_variant == "2020-resolver" else "you'll")
)
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, [
"broken 1.0 requires missing, which is not installed.",
"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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册