-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
I'd like to add to my setup.cfg
[mypy]
warn_unused_ignores = True
warn_redundant_casts = True
However, I can't find a way to make it work because there are developers on the project that need to run mypy on Windows, and in the code there are OS-specific lines, e.g.
import os
import sys
if sys.platform != "win32":
os.sysconf("SC_IOV_MAX") # type: ignoreSee matching lines in typeshed:
https://github.com/python/typeshed/blob/963b8aa2f77187f381f75d9630b3d021aff55132/stdlib/os/__init__.pyi#L990-L994
With # type: ignore, mypy fails on Linux due to warn-unused-ignores.
Without it, it fails on Windows.
Is there a way to make it work, besides manually enabling the flag once in a while, do a one-off clean-up, and then disabling it?