Possible regression in 20.2b1: AssertionError: a direct req shouldn't have a parent...
See original GitHub issueEnvironment
- pip version: 20.2b1
- Python version: 3.8.4
- OS: Debian testing
Description
Given those two files:
$ cat setup.cfg
[metadata]
name = test
version = 0.0.1
description = test
[options]
install_requires =
oeis
$ cat setup.py
from setuptools import setup
setup()
when I run pip-compile setup.py
(from pip-tools), I get:
Traceback (most recent call last):
File "/tmp/pto/.venv/bin/pip-compile", line 8, in <module>
sys.exit(cli())
File "/tmp/pto/.venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/tmp/pto/.venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/tmp/pto/.venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/tmp/pto/.venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/tmp/pto/.venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/scripts/compile.py", line 458, in cli
results = resolver.resolve(max_rounds=max_rounds)
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/resolver.py", line 169, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/resolver.py", line 274, in _resolve_one_round
their_constraints.extend(self._iter_dependencies(best_match))
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/resolver.py", line 384, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/repositories/pypi.py", line 231, in get_dependencies
self._dependencies_cache[ireq] = self.resolve_reqs(
File "/tmp/pto/.venv/lib/python3.8/site-packages/piptools/repositories/pypi.py", line 171, in resolve_reqs
reqset.add_requirement(ireq)
File "/tmp/pto/.venv/lib/python3.8/site-packages/pip/_internal/req/req_set.py", line 113, in add_requirement
assert install_req.is_direct == (parent_req_name is None), (
AssertionError: a direct req shouldn't have a parent and also, a non direct req should have a parent
But I don’t get this with pip 20.1.1.
I did not tried to reproduce with pip only yet, so my reproducer is still bound to pip-tools, which is not ideal, I know.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Changelog - pip documentation v22.3.1
Fix a regression that made pip wheel do a VCS export instead of a VCS clone for editable requirements. This broke VCS requirements...
Read more >pip Changelog - pyup.io
Fix a regression that made ``pip wheel`` do a VCS export instead of a VCS clone for editable requirements. This broke VCS requirements...
Read more >A command-line script to get all the contributors for one or more ...
Contributors A command-line script to get all the contributors for one or more GitHub projects. Free software: Apache Software License 2.0 Documentation: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tested again, in the exact same environment and can’t reproduce it. It’s funny because I still have the terminal where I made it fail:
The initial failure, leading me to open this issue, that I still had in a terminal history.
Having this in my terminal history is great because I have the exact versions of each packets so I can try an exact reproducer:
Me trying to reproduce it again, failing.
OK so this is harder to reproduce than initially though, I don’t understand what’s happening here, either a cache issue, or a Schrödinger bug?
pip-tools
calls pip internals directly, which we don’t support (andpip-tools
are fine with that, as far as I know). So this should be tracked via the pip-tools issue, not here. In particular,pip-tools
is modifyingis_direct
/user_supplied
on anireq
, which seems very brave of them if you ask me 🙂If it’s possible to reproduce with just pip, then we can take a look.