from package.module import Anything
class Thing:
pass
package/module.py
from package.subpackage.module import Thing
class Anything:
pass
Expected behaviour
I consider this a circular import but pycycle detects no errors.
Executing run.py results in a circular import error:
Traceback (most recent call last):
File "run.py", line 1, in <module>
from package.module import Anything
File "/home/dom/Code/package/package/module.py", line 1, in <module>
from package.subpackage.module import Thing
File "/home/dom/Code/package/package/subpackage/module.py", line 1, in <module>
from package.module import Anything
ImportError: cannot import name 'Anything' from 'package.module' (/home/dom/Code/package/package/module.py)
An archive containing the package structure and code.
package.tar.gz
Summary
My example is the following package structure where
package.subpackage.module
imports frompackage.module
and visa-versa.run.py
package/subpackage/module.py
package/module.py
Expected behaviour
I consider this a circular import but pycycle detects no errors.
Executing
run.py
results in a circular import error:An archive containing the package structure and code. package.tar.gz