From 631b0b648f37f8ead082eb57fccf33fb2939e553 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Wed, 4 Nov 2020 21:27:16 +0800 Subject: [PATCH] Use set to dedup package list in error message --- src/pip/_internal/resolution/resolvelib/factory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py index 8e1a68d168d..c65cb7f76f8 100644 --- a/src/pip/_internal/resolution/resolvelib/factory.py +++ b/src/pip/_internal/resolution/resolvelib/factory.py @@ -406,19 +406,19 @@ def describe_trigger(parent): # type: (Candidate) -> str ireq = parent.get_install_requirement() if not ireq or not ireq.comes_from: - return "{} {}".format(parent.name, parent.version) + return "{}=={}".format(parent.name, parent.version) if isinstance(ireq.comes_from, InstallRequirement): return str(ireq.comes_from.name) return str(ireq.comes_from) - triggers = [] + triggers = set() for req, parent in e.causes: if parent is None: # This is a root requirement, so we can report it directly trigger = req.format_for_error() else: trigger = describe_trigger(parent) - triggers.append(trigger) + triggers.add(trigger) if triggers: info = text_join(sorted(triggers))