diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25be0caa502..9c209e29cc5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - id: pyupgrade args: [--keep-percent-format] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910 # NOTE: keep this in sync with setup.py. + rev: v0.931 # NOTE: keep this in sync with setup.py. hooks: - id: mypy files: ^(src/|testing/) diff --git a/setup.py b/setup.py index 4982b2381a8..b09e2b30cfb 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def main(): "xmlschema", ], # fmt: on "checkqa-mypy": [ - "mypy==v0.910", # keep this in sync with .pre-commit-config.yaml. + "mypy==v0.931", # keep this in sync with .pre-commit-config.yaml. "types-setuptools", ], }, diff --git a/tox.ini b/tox.ini index f1e7319658c..d53cdd7b570 100644 --- a/tox.ini +++ b/tox.ini @@ -95,10 +95,15 @@ commands = mypy {posargs:src testing} # Checks minimum supported Python version, and general checks. # This uses the actual Python version, so that mypy does not fail with # unsupported deps (e.g. packaging 21 on py35, causing a mypy syntax error). +# NOTE: mypy v0.920 dropped support for Python 3.5, so it is pinned to v0.910. +# And since tox does not allow for overriding deps from extras, they are +# inlined here. [testenv:mypy_ci_min] basepython = python3.5 -deps = {[testenv:mypy]deps} -extras = {[testenv:mypy]extras} +deps = + mypy==v0.910 + types-setuptools +extras = whitelist_externals = sh commands = mypy --python-version 3.5 --warn-unused-ignores {posargs:src testing}