Skip to content

Commit

Permalink
Use set to dedup package list in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Nov 4, 2020
1 parent 0512785 commit 631b0b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pip/_internal/resolution/resolvelib/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 631b0b6

Please sign in to comment.