From d00c0183dedf81c0904f85f535635fa3af131187 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Tue, 29 Mar 2022 23:20:20 +0100 Subject: [PATCH 1/2] More idiomatic mypy configuration --- .pre-commit-config.yaml | 7 ++----- setup.cfg | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6276fe1c17..4852cff4b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,11 +34,7 @@ repos: rev: v0.942 hooks: - id: mypy - args: - - --ignore-missing-imports - # Silence errors about Python 3.9-style delayed type annotations on Python 3.8 - - --python-version - - "3.9" + args: [] additional_dependencies: # Type stubs - types-docutils @@ -46,6 +42,7 @@ repos: - types-paramiko - types-PyYAML - types-psutil + - types-setuptools # Typed libraries - numpy - dask diff --git a/setup.cfg b/setup.cfg index dd99eccfc7..34fa189fe2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -59,3 +59,8 @@ timeout_method = thread # This should not be reduced; Windows CI has been observed to be occasionally # exceptionally slow. timeout = 300 + +[mypy] +# Silence errors about Python 3.9-style delayed type annotations on Python 3.8 +python_version = 3.9 +ignore_missing_imports = true From ed91fb2410a2f48eff62b652bd49ded9e79773fb Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 30 Mar 2022 02:14:11 +0100 Subject: [PATCH 2/2] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4852cff4b6..cb9e74ed98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,7 @@ repos: rev: v0.942 hooks: - id: mypy + # Override default --ignore-missing-imports args: [] additional_dependencies: # Type stubs