Skip to content
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

Missing dependencies #277

Closed
Or-Geva opened this issue Aug 9, 2023 · 1 comment
Closed

Missing dependencies #277

Or-Geva opened this issue Aug 9, 2023 · 1 comment

Comments

@Or-Geva
Copy link

Or-Geva commented Aug 9, 2023

I have the following requirements.txt file:

django-debug-toolbar==1.4
django==1.9.5

After running pipdeptree i get the following:

django-debug-toolbar==1.4
├── Django [required: >=1.7, installed: 1.9.5]
└── sqlparse [required: Any, installed: 0.4.4]
pip==23.2.1
pipdeptree==2.12.0
setuptools==58.0.4

Shouldn't I see Django listed at level 0 similar to django-debug-toolbar?

@kemzeb
Copy link
Collaborator

kemzeb commented Aug 9, 2023

It would have been there, but because of this code:

if not list_all:
nodes = [p for p in nodes if p.key not in branch_keys]

Django will be seen as a dependency of django-debug-toolbar (just like sqlparse), and therefore will not add them at depth 0 in the output. Due of this behavior, it won't matter if you include Django in your requirements.txt as it will give you the same output without it. To add Django (and in effect sqlparse and any other packages' dependencies) as top-level packages, you could pass the -a option.

I'm not sure of a way (either using pip's API or somehow manipulating the PackageDAG) to detect Django as a top-level package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants