Conversation
fa63882 to
1b26c54
Compare
|
Hi, First of all, sorry about the delay in looking at the PR. I didn't understand the need for I think without the
This is quite similar to your implementation but there's no I haven't tried this actually but the way I see it is as follows - Currently pipdeptree cannot identify extra requirements For eg. if |
|
Hi, |
|
I don't understand why you differentiate: |
yes, but won't the
Am I missing anything?
There's no difference actually. But with |
|
Now I understand the confusion: your solution would only retain the extra dependencies that are installed on the system/virtualenv. The way I did it, all extra deps are mapped (even if not installed). I thought it'd be nice to see what is installed with which option, as prospecting if you wish. Do you think it's a bad idea? The reason why I wrote an As for the explicit call |
IMO, it's outside the scope of pipdeptree which is basically limited to only packages that are installed on the system/virtualenv. Not sure about the use case, but it could be a separate tool that provides this functionality.
Got it
Makes sense. Also, can you please also provide the |
|
Alright, I'll leave the external packages out. Here's the pip freeze: (pipdeptree, I installed with [Edited] I also installed |
b326abc to
cc114c5
Compare
|
I'm sorry but I can't seem to find where |
It was introduced in a recently merged PR #128. I think you rebased your branch with latest master? |
cc114c5 to
e190735
Compare
|
Ah yes, thanks. I didn't know github performed auto rebase on the pull request. |
e190735 to
e626c72
Compare
|
Alright, ready to merge on my side. Let me know if I can still do anything |
| @classmethod | ||
| def from_pkgs(cls, pkgs): | ||
| pkgs = [DistPackage(p) for p in pkgs] | ||
| pkgs = [DistPackage(p) for p in pkgs if p.key != 'pkg-resources'] |
There was a problem hiding this comment.
Why is 'pkg-resources' omitted? In case it's necessary to be omitted, it'd be good to have a comment explaining why. Just let me know the reason in that case, I'll add add the comment after merging the PR
There was a problem hiding this comment.
I guess it could be left in. I forgot that I added that. The only reason I did it was that it's not even on pypi.org, I think it's being installed as part of pip. It's always alone and without dependencies and shows a version of 0.0.0 which is weird.
But I don't mind deleting that if clause if you deem it a better option.
|
Hi, Thanks for your work on this long pending feature/bug. I wanted to suggest some refactoring but was finding it difficult to communicate exactly. So, I've cherry-picked your commits on another branch and added some more changes on top - #138. Still need to get the tests passing. Closing this PR. It will be merged via PR #138 Thanks |
|
Alright, perfect. Thank you too for your comments and for finishing the PR. |
`pipdeptree` has long ignored extra/optional dependencies defined via PEP 508 `extra` markers. When a user installs a package with extras (e.g. `pip install jira[signedtoken]`), the extra dependencies appear as unrelated top-level packages instead of showing up as children in the dependency tree. This has been a recurring pain point since issue #107 was opened, and previous attempts (#132, #138) were never merged. The new `--extras` / `-x` flag enables transitive resolution of extras in the dependency tree. 🔍 It works by collecting extras from requirement specifiers (e.g. `oauthlib[signedtoken]`), evaluating PEP 508 markers with the correct extras context via `marker.evaluate({"extra": name})`, and iterating until no new extras are discovered. Root packages (those not depended on by anything else) automatically include all their provided extras where the dependency is actually installed. Each extra dependency is annotated with its extra name across all output formats — text shows `extra: signedtoken`, JSON includes an `"extra"` field, and graphviz/mermaid prefix edge labels with `[signedtoken]`. The flag is off by default to preserve backward compatibility. No existing behavior changes when `--extras` is not passed. The `from_pkgs` constructor gained a keyword-only `include_extras` parameter, and the extras resolution runs as a separate pass after the base DAG is built, keeping the core construction logic clean.
Hi
I used your code for a project where the extra requirements were important. So I added support for them.
Let me know what you think.
Best