pydeps should ignore TYPE_CHECKING imports
josephdviviano opened this issue · 1 comments
josephdviviano commented
In order to avoid circular imports but support type checking against user-defined classes, the following is currently done:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from gfn.envs.env import Env
from gfn.containers.states import States
However this results in a circular or otherwise messy dependency graph in pydeps
, even though these imports are only used for type checking. To mitigate this, one solution would be to completely ignore all dependencies that fall under TYPE_CHECKING
, or optionally remove them from the output graph with a command line flag.
josephdviviano commented
I'm closing this - I think this feature does not make sense upon reflection.