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

2020 resolver: list out helpful info on basic resolution failures #9405

Merged
merged 2 commits into from
Feb 28, 2021
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/9139.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bring back the "(from versions: ...)" message, that was shown on resolution failures.
9 changes: 8 additions & 1 deletion src/pip/_internal/resolution/resolvelib/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,17 @@ def _report_single_requirement_conflict(self, req, parent):
req_disp = str(req)
else:
req_disp = f"{req} (from {parent.name})"

cands = self._finder.find_all_candidates(req.project_name)
versions = [str(v) for v in sorted({c.version for c in cands})]

logger.critical(
"Could not find a version that satisfies the requirement %s",
"Could not find a version that satisfies the requirement %s "
"(from versions: %s)",
req_disp,
", ".join(versions) or "none",
)

return DistributionNotFound(f"No matching distribution found for {req}")

def get_installation_error(
Expand Down