From 272c0b7061de9b009fe3f1c2a172763a0c5cfd3d Mon Sep 17 00:00:00 2001 From: "Kenneth J. Pronovici" Date: Mon, 25 Aug 2025 05:50:57 -0500 Subject: [PATCH 1/2] Update the MyPy configuration so we're using latest rules --- Changelog | 1 + pyproject.toml | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index 5639d98..0133798 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ Version 0.1.27 unreleased * Adjust GHA build process to allow builds for stacked PRs. * Add a new `run clean` target to clean up generated data. * Move unit tests from `tests` into `src/tests/uciparse`. + * Update the MyPy configuration so we're using latest rules. * Update the jinja2 transitive dependency to address CVE-2025-27516. * Update the requests transitive dependency to address CVE-2024-47081. * Update the urllib3 transitive dependency to address CVE-2025-50181. diff --git a/pyproject.toml b/pyproject.toml index 89499e7..8a53b01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,12 +110,12 @@ filterwarnings = [ ] [tool.mypy] -# Settings are mostly equivalent to strict=true as of v1.14.1 +files = [ "src" ] pretty = true show_absolute_path = true show_column_numbers = true show_error_codes = true -files = [ "src" ] +# Settings equivalent to strict=true as of v1.17.1 check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true @@ -123,15 +123,18 @@ disallow_subclassing_any = true disallow_untyped_calls = true disallow_untyped_decorators = false disallow_untyped_defs = true -no_implicit_optional = true +extra_checks = true no_implicit_reexport = true strict_equality = true -strict_optional = true warn_redundant_casts = true warn_return_any = true -warn_no_return = true warn_unused_configs = true warn_unused_ignores = true +# Additional settings above and beyond strict=true +implicit_optional = false +strict_optional = true +warn_no_return = true +warn_unreachable = true # It's hard to make tests compliant using unittest.mock [[tool.mypy.overrides]] From 592c8f4b7c8a19d737338a58e669e7ae53a4b59b Mon Sep 17 00:00:00 2001 From: "Kenneth J. Pronovici" Date: Mon, 25 Aug 2025 05:52:58 -0500 Subject: [PATCH 2/2] Remove unneeded override --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a53b01..b894963 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -141,8 +141,3 @@ warn_unreachable = true module = "tests.*" check_untyped_defs = false allow_untyped_defs = true - -# There is no type hinting for pytest -[[tool.mypy.overrides]] -module = "pytest" -ignore_missing_imports = true