From bf01b58cb4e6f55c4af0871ec5bb3fd37bc03d10 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 24 Nov 2021 16:06:39 -0500 Subject: [PATCH] tweak mypy config (#9368) * tweak mypy config * add types-click to pre-commit --- .github/workflows/upload-pypi-source.yml | 3 +-- .pre-commit-config.yaml | 2 +- chia/cmds/chia.py | 2 +- mypy.ini | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index f6fc6caf2c..d788253a81 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -55,8 +55,7 @@ jobs: - name: Lint source with mypy run: | - mypy --exclude config.py tests - mypy chia + mypy - name: Build source distribution run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b868637507..aa1c4d545b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: rev: v0.910 hooks: - id: mypy - additional_dependencies: [types-aiofiles, types-setuptools, types-PyYAML] + additional_dependencies: [types-aiofiles, types-click, types-setuptools, types-PyYAML] # This intentionally counters the settings in mypy.ini to allow a loose local # check and a strict CI check. This difference may or may not be retained long # term. diff --git a/chia/cmds/chia.py b/chia/cmds/chia.py index b061f16f28..2c0c820a34 100644 --- a/chia/cmds/chia.py +++ b/chia/cmds/chia.py @@ -41,7 +41,7 @@ def monkey_patch_click() -> None: import click.core - click.core._verify_python3_env = lambda *args, **kwargs: 0 # type: ignore + click.core._verify_python3_env = lambda *args, **kwargs: 0 # type: ignore[attr-defined] @click.group( diff --git a/mypy.ini b/mypy.ini index fdb70956d4..2ae3429cb6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,7 @@ [mypy] +files = benchmarks,build_scripts,chia,tests,*.py ignore_missing_imports = True +show_error_codes = True warn_unused_ignores = True [mypy - lib]