then Depends will report dependencies going both ways (a.py depends on b.py AND b.py depends on a.py).
Technically, this might not be a valid Python import (I'm not sure) but you can find real code that does this. See this project praxis from Google. If you run depends on this project, you will find a circular dependency between praxis/pytypes.py and praxis/base_model.py. However, if you manually inspect these files, you will notice that the dependency should just be one-way (from base_model.py to pytypes.py). I tried to reduce this bug to its essentials with my initial example.
I tried to debug this myself and I suspect that both a.Foo and b.Foo are being mapped to the same entity. If you change line 3 of a.py to
Foo2 = b.Foo
then the wrong dependency is no longer reported by depends.
Say you have a file
example/b.py
that containsand another file
example/a.py
that containsthen Depends will report dependencies going both ways (
a.py
depends onb.py
ANDb.py
depends ona.py
).Technically, this might not be a valid Python import (I'm not sure) but you can find real code that does this. See this project praxis from Google. If you run depends on this project, you will find a circular dependency between
praxis/pytypes.py
andpraxis/base_model.py
. However, if you manually inspect these files, you will notice that the dependency should just be one-way (frombase_model.py
topytypes.py
). I tried to reduce this bug to its essentials with my initial example.I tried to debug this myself and I suspect that both
a.Foo
andb.Foo
are being mapped to the same entity. If you change line 3 ofa.py
tothen the wrong dependency is no longer reported by depends.