Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Present found conflicts when discarding some criterion #10937

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/10937.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Present conflict information during installation after each choice that is rejected (pass ``-vv`` to ``pip install`` to show it)
12 changes: 12 additions & 0 deletions src/pip/_internal/resolution/resolvelib/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ def rejecting_candidate(self, criterion: Any, candidate: Candidate) -> None:
message = self._messages_at_reject_count[count]
logger.info("INFO: %s", message.format(package_name=candidate.name))

msg = "Will try a different candidate, due to conflict:"
for req_info in criterion.information:
req, parent = req_info.requirement, req_info.parent
# Inspired by Factory.get_installation_error
msg += "\n "
if parent:
msg += f"{parent.name} {parent.version} depends on "
else:
msg += "The user requested "
msg += req.format_for_error()
logger.debug(msg)


class PipDebuggingReporter(BaseReporter):
"""A reporter that does an info log for every event it sees."""
Expand Down