Misleading ResolutionImpossible
message w/ a requirement duplicate and an incompatible Python runtime
#11321
Labels
C: dependency resolution
About choosing which dependencies to install
S: needs triage
Issues/PRs that need to be triaged
type: bug
A confirmed bug or unintended behavior
Description
I've faced this by updating a pip-tools-managed constraints file under Python 3.9 but using these pins under Python 3.6. Obviously, some of them were incompatible (which I didn't notice immediately) but the problem I'm reporting is how pip communicates what's happened.
Pip errors out, claiming that two user requests of the same package are conflicting, when they are not. One of the requests has an unspecified requested version so basically anything matches, and the other one is pinned to a specific release. So basically out of these two, the resolver would select the pinned one, and it'd be compatible with a more broad request.
Keeping the above in mind, what pip suggests in the error message is not really true/obvious. I suppose that because the pin has incompatible
python_version
, it's facing an actual (invisible to the user) conflict. But this information isn't mentioned in the log which leads to a misleading impression.I've crafted a reproducer below.
Expected behavior
The error message should specify that it's
Require-Python
that causes the problem, not two user requests that are actually compatible with each other.pip version
Unknown but I reproduced this locally with v22.2.1 and v21.3.1
Python version
3.6 on CI, reproduced locally with 3.8
OS
macos-latest @ GHA, Gentoo Linux locally
How to Reproduce
(in my case, this was caused by
setuptools
with older pip and older Python version but I've found another package to demonstrate it under a supported Python version)Output
Code of Conduct
The text was updated successfully, but these errors were encountered: