tox-dev / pipdeptree

A command line utility to display dependency tree of the installed Python packages

Home Page:https://pypi.python.org/pypi/pipdeptree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't detect dependency cycles

wimglenn opened this issue · comments

I created a dep cycle on test.pypi.org: jd_circular_a -> jd_circular_b -> jd_circular_c -> jd_circular_a

$ pip install -q --index-url=https://test.pypi.org/simple jd_circular_a
$ pip freeze
jd_circular_a==0.1.2
jd_circular_b==0.1.2
jd_circular_c==0.1.2
pipdeptree==2.3.3

pipdeptree recognises the packages are installed, but fails to detect the cyclic dependency.

>>> import pipdeptree
>>> pkgs = pipdeptree.get_installed_distributions()
>>> tree = pipdeptree.PackageDAG.from_pkgs(pkgs)
>>> for node in tree:
...     print(node)
... 
<DistPackage("wheel")>
<DistPackage("setuptools")>
<DistPackage("pipdeptree")>
<DistPackage("pip")>
<DistPackage("jd-circular-c")>
<DistPackage("jd-circular-b")>
<DistPackage("jd-circular-a")>
>>> pipdeptree.cyclic_deps(tree)
[]

moreover it doesn't render them at all by default:

$ pipdeptree
pip==22.3.1
pipdeptree==2.3.3
setuptools==66.0.0
wheel==0.38.4