summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPradyun Gedam <3275593+pradyunsg@users.noreply.github.com>2021-02-28 08:43:33 +0000
committerGitHub <noreply@github.com>2021-02-28 08:43:33 +0000
commit8223d29b3991945e8a4863429ee0f2757fc0cb70 (patch)
tree613eafa2bd24e02ae3615c9a5d05ac8d57e600c9
parent1c46f30a3e0bf7812c69adf17c4e31e94362a790 (diff)
parentd1d914597c9bedef22cd30422f04ca4ea6799f3c (diff)
downloadpip-8223d29b3991945e8a4863429ee0f2757fc0cb70.tar.gz
Merge pull request #9405 from MrMino/diagnostic_aversion
-rw-r--r--news/9139.feature.rst1
-rw-r--r--src/pip/_internal/resolution/resolvelib/factory.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/news/9139.feature.rst b/news/9139.feature.rst
new file mode 100644
index 000000000..98dc133a1
--- /dev/null
+++ b/news/9139.feature.rst
@@ -0,0 +1 @@
+Bring back the "(from versions: ...)" message, that was shown on resolution failures.
diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py
index 3181d5753..fbf04fa4f 100644
--- a/src/pip/_internal/resolution/resolvelib/factory.py
+++ b/src/pip/_internal/resolution/resolvelib/factory.py
@@ -410,10 +410,17 @@ class Factory:
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(