Missing dependencies
Or-Geva opened this issue · comments
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
?
It would have been there, but because of this code:
pipdeptree/src/pipdeptree/_render/text.py
Lines 30 to 31 in 63c4090
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.