Skip to content

Commit

Permalink
Merge pull request #9405 from MrMino/diagnostic_aversion
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg authored Feb 28, 2021
2 parents 1c46f30 + d1d9145 commit 8223d29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 8223d29

Please sign in to comment.