Make it easier for contributors to run cross-platform mypy checks #7525
Labels
state: needs discussion
This needs some more discussion
type: maintenance
Related to Development and Maintenance Processes
What's the problem this feature will solve?
Currently when mypy is run only compatibility with the current platform is tested. Some APIs are platform-dependent, and by default mypy will only detect that if it is running on the platform in question.
This makes it harder to ensure that typing checks will succeed on all platforms (which will matter after #7520 is merged), which could be a surprise for contributors that took the time to run the lint checks locally.
Describe the solution you'd like
mypy supports a
--platform
flag (docs). We should configure pre-commit so that mypy is executed by default for all combinations of Linux, macOS, and Windows for Python 2 and 3.How fast this is will depend on the criteria mypy uses for its cache.
Alternative Solutions
alias
option. With these together it should be possible to come up with a default behavior for contributors that are runningtox -e lint
, but still allow us to reduce the amount of local configuration changes that contributors wanting faster or more thorough checks have to maintain.Additional context
The text was updated successfully, but these errors were encountered: