Skip to content

Wrong conflict is reported when both compatible and incompatible python_requires exist #9541

Closed
@pachewise

Description

@pachewise

Environment

  • pip version: 20.3.3, 21.0.1
  • Python version: 3.9.1, 3.8.7
  • OS: macOS Catalina, Docker python:3.9, Docker python:3.8

Description
Getting this weird error on one of our internal libraries (git+ssh) that has a python_requires=">=3.6":

ERROR: Package 'xxxxx' requires a different Python: 3.9.1 not in '>=3.6'

Installing the package directly works (pip install git+ssh://... as well as pip install -e .), but it fails on the requirements file (which has other git+ssh calls, but those other ones don't have python_requires).

Expected behavior
Successfully installs the package.

How to Reproduce
Having trouble creating an "isolated" testcase. The three factors seem to be: (1) requirements.txt; (2) git+ssh; (3) python_requires in the setup.py of the dependency (Django, for example, has python_requires >= 3.6 in their setup.cfg, but it installs successfully).

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.
# ...
Collecting xxxxx==0.0.3
  Cloning ssh://****@github.com/yyyyy/xxxxx (to revision 0.0.3) to /tmp/pip-install-ndn6x7f3/xxxxx_4765c045eeb2421f85443ae590d6fa3b
# ... 
INFO: pip is looking at multiple versions of xxxxx to determine which version is compatible with other requirements. This could take a while.
ERROR: Package 'xxxxx' requires a different Python: 3.9.1 not in '>=3.6'

Have removed the package info, but should not be relevant in this case since it is possible to install this package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions