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

Resolver error message is misleading when requested extra is only available in incompatible versions #9683

Open
1 task done
ThiefMaster opened this issue Mar 3, 2021 · 5 comments
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages type: enhancement Improvements to functionality

Comments

@ThiefMaster
Copy link

pip version

21.0.1

Python version

3.9.2

OS

Linux

Additional information

No response

Description

If I try to install a package with the requirements Authlib==1.0.0a1, Flask-Multipass>=0.3.1,<0.4-dev, Flask-Multipass-CERN pip is not able to install it because of Flask-Multipass-CERN requiring Flask-Multipass[authlib] which in turn
requires authlib[client]>=0.14.1,<1.0.

However, since Version('1.0.0a1') < Version('1.0') succeeds (with the Version class from packaging), I would expect the dependency resolution to succeed.

Expected behavior

The specified packages should be installed.

How to Reproduce

Create a setup.cfg containing this:

[metadata]
name = deptest
version = 1.0-dev

[options]
install_requires =
    Authlib==1.0.0a1
    Flask-Multipass>=0.3.1,<0.4-dev
    Flask-Multipass-CERN

and a setup.py with

from setuptools import setup
setup()

Run pip install -e .

Output

[adrian@claptrap:/tmp/deptest]> pip install -e .
Obtaining file:///tmp/deptest
Collecting Authlib==1.0.0a1
  Using cached Authlib-1.0.0a1-py2.py3-none-any.whl (207 kB)
Collecting Flask-Multipass<0.4-dev,>=0.3.1
  Using cached Flask_Multipass-0.3.3-py2.py3-none-any.whl (38 kB)
Collecting Flask-Multipass-CERN
  Using cached Flask_Multipass_CERN-1.0.dev4-py2.py3-none-any.whl (6.1 kB)
Collecting cryptography<4,>=3.2
  Using cached cryptography-3.4.6-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
Collecting cffi>=1.12
  Using cached cffi-1.14.5-cp39-cp39-manylinux1_x86_64.whl (406 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Collecting Flask>=0.10.1
  Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting blinker
  Using cached blinker-1.4.tar.gz (111 kB)
Collecting Jinja2>=2.10.1
  Using cached Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
Collecting click>=5.1
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting itsdangerous>=0.24
  Using cached itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Werkzeug>=0.15
  Using cached Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting MarkupSafe>=0.23
  Using cached MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl (32 kB)
Collecting authlib[client]<1.0,>=0.14.1
  Using cached Authlib-0.15.3-py2.py3-none-any.whl (203 kB)
  Using cached Authlib-0.15.2-py2.py3-none-any.whl (203 kB)
  Using cached Authlib-0.15.1-py2.py3-none-any.whl (203 kB)
  Using cached Authlib-0.15-py2.py3-none-any.whl (202 kB)
  Using cached Authlib-0.14.3-py2.py3-none-any.whl (215 kB)
  Using cached Authlib-0.14.2-py2.py3-none-any.whl (227 kB)
  Using cached Authlib-0.14.1-py2.py3-none-any.whl (227 kB)
INFO: pip is looking at multiple versions of flask-multipass[authlib] to determine which version is compatible with other requirements. This could take a while.
Collecting flask-multipass[authlib]>=0.3.dev5
  Using cached Flask_Multipass-0.3.2-py2.py3-none-any.whl (38 kB)
  Using cached Flask_Multipass-0.3.1-py2.py3-none-any.whl (38 kB)
  Using cached Flask_Multipass-0.3-py2.py3-none-any.whl (38 kB)
  Using cached Flask_Multipass-0.3.dev5-py2.py3-none-any.whl (38 kB)
INFO: pip is looking at multiple versions of flask-multipass to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of flask-multipass-cern to determine which version is compatible with other requirements. This could take a while.
Collecting Flask-Multipass-CERN
  Using cached Flask_Multipass_CERN-1.0.dev3-py2.py3-none-any.whl (6.0 kB)
  Using cached Flask_Multipass_CERN-1.0.dev2-py2.py3-none-any.whl (5.8 kB)
  Using cached Flask_Multipass_CERN-1.0.dev1-py2.py3-none-any.whl (5.7 kB)
  Using cached Flask_Multipass_CERN-1.0.dev0-py2.py3-none-any.whl (5.8 kB)
INFO: pip is looking at multiple versions of flask-multipass[authlib] to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of flask-multipass to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of blinker to determine which version is compatible with other requirements. This could take a while.
Collecting blinker
  Using cached blinker-1.3.tar.gz (91 kB)
  Using cached blinker-1.2.tar.gz (66 kB)
  Using cached blinker-1.1.zip (79 kB)
  Using cached blinker-1.0.tar.gz (61 kB)
  Using cached blinker-0.9.tar.gz (60 kB)
  Using cached blinker-0.8.tar.gz (9.8 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of flask-multipass-cern to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
^CERROR: Operation cancelled by user

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@ThiefMaster ThiefMaster added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 3, 2021
@uranusjr
Copy link
Member

uranusjr commented Mar 3, 2021

Can you try if installation would work if you add an additional requirement authlib[client]==1.0.0a1? I think I may know what’s going on.

@ThiefMaster
Copy link
Author

While trying to do that I just realized that authlib==1.0.0a no longer has a [client] extra (lepture/authlib#327)... I guess that explains it...

@uranusjr
Copy link
Member

uranusjr commented Mar 3, 2021

Oof, that's unfortunate. I wonder how we can make the error message clearer. What would you expect the log to show in this situation?

@ThiefMaster
Copy link
Author

With Authlib==1.0.0a1 being an exact requirement, where trying other authlib versions makes no sense, I think an error clearly indicating that there is no [client] extra (or whatever other reason prevents it from being installed) would help a lot.

@uranusjr
Copy link
Member

uranusjr commented Mar 4, 2021

Thanks, I’ll use this to track this enhancement.

@uranusjr uranusjr added C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages type: enhancement Improvements to functionality and removed S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 4, 2021
@uranusjr uranusjr changed the title pip refuses to install a prerelease when the final version is excluded Resolver error message is misleading when requested extra is only available in incompatible versions Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

2 participants