The mirrors-mypy pre-commit hook only takes into account the dependencies that are explicitly added in the .pre-commit-config file. This misses additional typing context that may come from other dependencies. Specifically here, running mypy via pre-commit passes, but installing mypy==0.971 and running mypy -p eth_account gives:
site-packages/pydantic_core/_pydantic_core.pyi:64: error: Positional-only parameters are only supported in Python 3.8 and greater
Found 1 error in 1 file (errors prevented further checking)
Bumping to mypy v1.10.0 in the pre-commit hook yields 25 errors, while installing and running locally yields 32.
How fixed
Added mypy==1.10.0 to dev dependencies and set pre-commit to run that instead of its own copy.
Fixed new mypy errors.
Many of the errors are related to strict_optional checking. In order to make this PR more focused, I set it to ignore the strict_optional rule, can do that in a dedicated PR.
Todo:
[x] Clean up commit history
[x] Add or update documentation related to these changes
What was wrong?
The
mirrors-mypy
pre-commit hook only takes into account the dependencies that are explicitly added in the.pre-commit-config
file. This misses additional typing context that may come from other dependencies. Specifically here, running mypy via pre-commit passes, but installingmypy==0.971
and runningmypy -p eth_account
gives:Bumping to mypy
v1.10.0
in the pre-commit hook yields 25 errors, while installing and running locally yields 32.How fixed
Added
mypy==1.10.0
to dev dependencies and set pre-commit to run that instead of its own copy. Fixed new mypy errors.Many of the errors are related to
strict_optional
checking. In order to make this PR more focused, I set it to ignore thestrict_optional
rule, can do that in a dedicated PR.Todo:
Cute Animal Picture