You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code which is protected by TYPE_CHECKING is listed as a required import. I'm not sure if to class this as a bug or a feature request but this template fits better.
Thanks for reporting! Agree that TYPE_CHECKING imports should be disregarded by FawltyDeps. Although they are needed by Mypy (or other type checkers) these tools are perfectly capable of reporting the missing dependency themselves.
We're not sure when we'll get to this, so if you want to take a stab at a PR in the meantime we'll be happy to look at it.
Edit: We don't see this as an urgent issue, as the workaround here is straightforward: Add bar (the modules conditionally imported under TYPE_CHECKING) to the set of undeclared dependencies to be ignored, i.e. compare:
Describe the bug
Code which is protected by
TYPE_CHECKING
is listed as a required import. I'm not sure if to class this as a bug or a feature request but this template fits better.For example:
To Reproduce
Expected behavior
Import protected by
TYPE_CHECKING
can be ignored.Environment
Additional context
The text was updated successfully, but these errors were encountered: