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

Merge pull request #9101 from uranusjr/new-resolver-error-message-dedup

Use set to dedup package list in error message
New resolver: Show each requirement in the conflict error message only once to reduce cluttering.
......@@ -406,19 +406,19 @@ class Factory(object):
# 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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册