module = None
optional import shows error locally but not from tox
#10512
Labels
bug
mypy got something wrong
In Flask, we have the following lines:
Running mypy shows an error:
However, adding a
# type: ignore
comment, then running mypy through tox shows an error about the ignore:Running tox without the comment shows everything passing.
So we're left in the situation where we need to pass in CI, but if anyone runs mypy locally they see this error, fix it, then CI fails for them.
What's extra strange is that right below the failing code is another optional import, with the ignore comment, that passes both locally and through tox.
setup.cfg
: https://github.com/pallets/flask/blob/b5518e23f5b85ba6e069a8151ed42209947f3849/setup.cfg#L89-L105The text was updated successfully, but these errors were encountered: