Skip to content

Commit 1587170

Browse files
authored
Merge pull request #9124 from pradyunsg/nicer-error-message-wording
Update message displayed on conflicts post-resolution
2 parents 5eae3c9 + 7be9157 commit 1587170

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/pip/_internal/commands/install.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,16 @@ def _warn_about_conflicts(self, conflict_details, resolver_variant):
529529
parts = [] # type: List[str]
530530
if resolver_variant == "legacy":
531531
parts.append(
532-
"After October 2020 you may experience errors when installing "
533-
"or updating packages. This is because pip will change the "
534-
"way that it resolves dependency conflicts.\n"
532+
"pip's legacy dependency resolver does not consider dependency "
533+
"conflicts when selecting packages. This behaviour is the "
534+
"source of the following dependency conflicts."
535535
)
536+
else:
537+
assert resolver_variant == "2020-resolver"
536538
parts.append(
537-
"We recommend you use --use-feature=2020-resolver to test "
538-
"your packages with the new resolver before it becomes the "
539-
"default.\n"
539+
"pip's dependency resolver does not currently take into account "
540+
"all the packages that are installed. This behaviour is the "
541+
"source of the following dependency conflicts."
540542
)
541543

542544
# NOTE: There is some duplication here, with commands/check.py
@@ -557,14 +559,15 @@ def _warn_about_conflicts(self, conflict_details, resolver_variant):
557559
version = package_set[project_name][0]
558560
for dep_name, dep_version, req in conflicting[project_name]:
559561
message = (
560-
"{name} {version} requires {requirement}, but you'll have "
562+
"{name} {version} requires {requirement}, but {you} have "
561563
"{dep_name} {dep_version} which is incompatible."
562564
).format(
563565
name=project_name,
564566
version=version,
565567
requirement=req,
566568
dep_name=dep_name,
567569
dep_version=dep_version,
570+
you=("you" if resolver_variant == "2020-resolver" else "you'll")
568571
)
569572
parts.append(message)
570573

tests/functional/test_install_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_check_install_does_not_warn_for_out_of_graph_issues(script):
8989
assert_contains_expected_lines(result.stderr, [
9090
"broken 1.0 requires missing, which is not installed.",
9191
"broken 1.0 requires conflict<1.0, "
92-
"but you'll have conflict 1.0 which is incompatible."
92+
"but you have conflict 1.0 which is incompatible."
9393
])
9494

9595
# Install unrelated package

0 commit comments

Comments
 (0)