From e6911d910ae6cd4d567b7e6746d75aceefa437b8 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 30 Mar 2022 02:39:40 +0100 Subject: [PATCH] More idiomatic mypy configuration (#6022) --- .pre-commit-config.yaml | 8 +++----- setup.cfg | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6276fe1c17..cb9e74ed98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,11 +34,8 @@ 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" + # Override default --ignore-missing-imports + args: [] additional_dependencies: # Type stubs - types-docutils @@ -46,6 +43,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