-
Notifications
You must be signed in to change notification settings - Fork 14
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
Error when package requires itself #95
Comments
Hi @jdchn 👋 First of all, thanks for the reproducible bug report! This is a hard crash in the vendored and adapted # If we have two terms that refer to the same package but have a null
# intersection, they're mutually exclusive, making this incompatibility
# irrelevant, since we already know that mutually exclusive version
# ranges are incompatible. We should never derive an irrelevant
# incompatibility.
assert by_ref[ref] is not None From a first glance, this one might be triggered because the package requires itself, something I haven't seen in the wild before (or even knew was allowed). Let me think how to properly handle this cyclic dependency, it might not be a trivial fix. |
It looks like poetry does not support the pattern, whereas pip happily installs it. I strive for pip compliance, so this needs a fix for sure. pipgrip currently combines multiple extras alphabetically, e.g. here you could expect to encounter somewhere in pipgrip's output: What etils is doing is next level. It will make for a beautiful test case... I would expect to find etils listed as dependency of itself in the tree (even though it's only a "trick" used by their devs to express the needed dependencies depending on scenario), it would be incorrect to expect pipgrip to "flatten" and resolve this into a list of (only) external dependencies. Not strictly true:
Expected:
without warnings of cyclic dependencies. It only gets cyclic if the same extra is encountered down the tree, e.g. if
This gets iffy, because there might additionally be version specifiers for etils added to this scenario, in which case there is potential for a "etils>=0.7 depends on etils==0.6.0, thats a no-no" exit. That leads me to the conclusion that this needs a fix in the vendored package, as full version solving capabilities need to be retained. |
It may be a little trickier than it seems. It will be tempting to simply treat self-references as normal dependencies, but there should be some caveats:
The above is probably what would be expected, but I don't know what Pip will actually do. I think there's also another related issue:
Command output
Traceback (most recent call last):
File "/home/vagrant/.local/bin/pipgrip", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/vagrant/.local/lib/python3.8/site-packages/pipgrip/cli.py", line 460, in main
raise RuntimeError(
RuntimeError: Unexpected partial solution encountered, not all packages have decisions
|
Thanks for reporting that one too! Separate bug, yet related 🤔 |
Released 0.9.0 |
What you were trying to do (and why)
Analyze the dependencies for a
requirements.txt
file containing jax.The error can be isolated to the jax dependency etils[epath].
What happened (including command output)
Command output
What you expected to happen
Expected to see dependency tree for jax.
Step-by-step reproduction instructions
In an Ubuntu 20.04 or RHEL UBI 8 environment (VM or container) with Python 3.8...
pipgrip -vv --tree etils[epath]
.The text was updated successfully, but these errors were encountered: