From 256f3420b1f29f1ea004c46843081cd8fae444cf Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 21 Feb 2025 02:27:23 +0300 Subject: [PATCH] Add `--local-partial-types` and `--strict-bytes` to mypy (#4583) --- .pre-commit-config.yaml | 3 ++- pyproject.toml | 2 ++ scripts/fuzz.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f1bae9..37ad51d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,13 +39,14 @@ repos: exclude: ^src/blib2to3/ - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.1 + rev: v1.15.0 hooks: - id: mypy exclude: ^(docs/conf.py|scripts/generate_schema.py)$ args: [] additional_dependencies: &mypy_deps - types-PyYAML + - types-atheris - tomli >= 0.2.6, < 2.0.0 - click >= 8.1.0, != 8.1.4, != 8.1.5 - packaging >= 22.0 diff --git a/pyproject.toml b/pyproject.toml index 8c28d25..eb46241 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -224,6 +224,8 @@ branch = true python_version = "3.9" mypy_path = "src" strict = true +strict_bytes = true +local_partial_types = true # Unreachable blocks have been an issue when compiling mypyc, let's try to avoid 'em in the first place. warn_unreachable = true implicit_reexport = true diff --git a/scripts/fuzz.py b/scripts/fuzz.py index 018b66e..0c50738 100644 --- a/scripts/fuzz.py +++ b/scripts/fuzz.py @@ -80,7 +80,7 @@ def test_idempotent_any_syntatically_valid_python( try: import sys - import atheris # type: ignore[import-not-found] + import atheris except ImportError: pass else: