-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Resolving package with duplicate dependencies results in incorrect constraint #1658
Comments
Have you tried |
The backtracking resolver does indeed pick up the correct version ( My short term solution was to modify the requirements file manually to fix the constraint, as |
Switching to the backtracking resolver is highly encouraged since there are no further plans to support the legacy resolver. Thanks for the issue anyway! |
Thanks, i'll update my projects to the new resolver. Look forward to it becoming the default with #1659 |
pip-tools resolves mypy to an incompatible version Raised upstream as jazzband/pip-tools#1658
When trying to resolve a package which depends on its dependency twice, but with different constraints (Eg as a core dependency and in an extra), it's possible for the resulting constraint to not be valid, as if the extra dependency had been ignored.
I can reliably replicate this with a specific package:
django-stubs[compatible-mypy]
.From some debugging, it appears that the first round of resolving correctly picks up the initial constraint of
mypy>=0.930
, however the extra actually defines the constraint with an upper bound (mypy>=0.930,<0.970
). This extra constraint doesn't appear to ever be considered during resolution.Environment Versions
$ python -V
3.10$ pip --version
22.2.0$ pip-compile --version
6.8.0Steps to replicate
django-stubs[compatible-mypy]
pip-compile
Expected result
mypy is pinned to
0.961
- the latest version to match the constraintsActual result
mypy is pinned to
0.971
, which during apip install
results in a failure:The text was updated successfully, but these errors were encountered: