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
I think related to #6897 which was closed, but I often want to enable type checking on a module that imports a number of 3p packages that I have no control over.
However, I am finding that the import-following behavior for mypy is quite sensitive to things that I can't really control or easily ignore. I would expect that --follow-imports=silent would gracefully degrade in situations where this happens, but I find many cases where a stray comment (e.g. # type: some comment that's not actually a type specification) will cause a syntax error that causes the whole execution to error, and I can't find a way to ignore it without completely disabling --follow-imports.
I've encountered this with stray comments in tensorflow, for example. Is there any way to more gracefully fallback and recover from these kinds of errors in mypy? Or at least allow more fine-grained control on import following to not fail on syntax errors for specific external modules?
The text was updated successfully, but these errors were encountered:
However, the description of the silent option says that it "behaves in the same way as normal but will additionally suppress any error messages." However, it doesn't appear to be suppressing errors unless I explicitly configure each broken package as above, so either this is a bug, or that description should be clarified to describe when it will or won't skip errors in followed imports.
I think related to #6897 which was closed, but I often want to enable type checking on a module that imports a number of 3p packages that I have no control over.
However, I am finding that the import-following behavior for mypy is quite sensitive to things that I can't really control or easily ignore. I would expect that
--follow-imports=silent
would gracefully degrade in situations where this happens, but I find many cases where a stray comment (e.g.# type: some comment that's not actually a type specification
) will cause a syntax error that causes the whole execution to error, and I can't find a way to ignore it without completely disabling--follow-imports
.I've encountered this with stray comments in tensorflow, for example. Is there any way to more gracefully fallback and recover from these kinds of errors in mypy? Or at least allow more fine-grained control on import following to not fail on syntax errors for specific external modules?
The text was updated successfully, but these errors were encountered: