pip-tools: pip-compile doesn't support the new pip resolver
pip-compile doesn’t support using the 2020 resolver.
Environment Versions
- OS Type macOS
- Python version:
$ python -V: Python 3.7.8 - pip version:
$ pip --version: pip 20.2 - pip-tools version:
$ pip-compile --version: pip-compile, version 5.3.0
Steps to replicate
- Create
t.txt:--use-feature=2020-resolver boto3 - Run
pip-compile t.txt:
Traceback (most recent call last):
File ".tox/pip-compile/bin/pip-compile", line 8, in <module>
sys.exit(cli())
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/scripts/compile.py", line 458, in cli
results = resolver.resolve(max_rounds=max_rounds)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/resolver.py", line 169, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/resolver.py", line 274, in _resolve_one_round
their_constraints.extend(self._iter_dependencies(best_match))
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/resolver.py", line 384, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/repositories/local.py", line 75, in get_dependencies
return self.repository.get_dependencies(ireq)
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/repositories/pypi.py", line 232, in get_dependencies
download_dir, ireq, wheel_cache
File "/Users/andy/gr/gold/.tox/pip-compile/lib/python3.7/site-packages/piptools/repositories/pypi.py", line 184, in resolve_reqs
results = resolver._resolve_one(reqset, ireq)
AttributeError: 'Resolver' object has no attribute '_resolve_one'
Expected result
pip-compile completes successfully.
Actual result
pip-compile errors out.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 26
- Comments: 26 (15 by maintainers)
Commits related to this issue
- Update pip-tools to fix pip-compile error with pip>=20.2. https://github.com/jazzband/pip-tools/issues/1190 — committed to spendnetwork/silvereye by SimKennedy 4 years ago
#1539 adds support for new resolver and fixes the issue:
Details
The resolver is released as part of pip-tools
v6.8.0🎉@atugushev I can’t say how much this saved the day for me - thank you for getting this in there when you did!
confirmed pip-compile can’t handle,
but pip finds valid solution:
So sounds like no ones working on this?
This issue is critical as the new resolver is days away from becoming default. If you was one of those that added
use-feature = 2020-resolverto your~/.config/pip/pip.confin order to benefit from extra conflict resolution in newer resolver you are unable to use pip-compile at all.Well pip never considers the internal API stable right? 😃
For my purposes I don’t actually need the new resolver logic except to deal with https://github.com/pypa/pip/issues/5780. If you don’t think the new resolver internals are stable enough for pip-tools yet, I’m sure I can come up with some hack to work around this issue. 😃
@Eric-Arellano there’s a new lock file spec here too https://www.python.org/dev/peps/pep-0665/
Hi, I’m a maintainer at https://github.com/pantsbuild/pants. We’re working on a revamp of our 3rd-party support with lockfiles at the crux of the changes. We’ve been using pip-compile so far and are really happy with it so far, great UX!
This issue is a blocker for us to call the project complete. We’re interested in taking on this issue, but are trying to scope it out: how much work would you anticipate this change will take?
Also, would anyone be available to help, like giving some tips or pair programming?
Finally, Pants still supports Python 2.7, so we’d ideally backport this feature to pip-tools 5, in addition to pip-tools 6. How feasible do you expect a backport like that would be?
I have simplest example:
req.txt:pip-compile fails with:
but pip install succeed with:
Tested on both pypi and github-master versions of pip-tools. Latest pip (since pip-tools required it).
If I change
req.txtas:Then I get pip-compile succeed with:
I…uh…played a bit with the settings hence and forth and suddenly it started working and I can’t break it anymore. 😳 It was 100% 5.4.0/20.3 before. I guess my computer is just haunted.
apologies, that was 5.1.2, works with 5.3.1 👍 @atugushev