From b0ff292799b5f702ecca20520ad41a861ac0a1fd Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 24 Jul 2025 23:12:37 +0000 Subject: [PATCH] Remove flake8-mypy in favor of direct mypy usage Signed-off-by: Dom Del Nano --- .arclint | 9 ++++++ .flake8rc | 31 ------------------- .pxl.flake8rc | 31 ------------------- docker.properties | 8 ++--- mypy.ini | 29 +++++++++++++++++ .../chef/cookbooks/px_dev/recipes/linters.rb | 2 +- 6 files changed, 43 insertions(+), 67 deletions(-) create mode 100644 mypy.ini diff --git a/.arclint b/.arclint index 560c165400b..7b87106fe80 100644 --- a/.arclint +++ b/.arclint @@ -118,6 +118,15 @@ "(\\.pxl$)" ] }, + "mypy": { + "type": "script-and-regex", + "include": [ + "(\\.py$)", + "(\\.pxl$)" + ], + "script-and-regex.script": "mypy --config-file=mypy.ini", + "script-and-regex.regex": "/^(?P.*):(?P\\d+): (?Perror|warning): (?P.*)$/m" + }, "gazelle": { "type": "script-and-regex", "include": [ diff --git a/.flake8rc b/.flake8rc index 7ac2300df1f..2b85d85caf8 100644 --- a/.flake8rc +++ b/.flake8rc @@ -4,34 +4,3 @@ max-line-length = 120 # N802: Function names have to be lower case. This is for GRPC service. # E999: Mistaken error see https://github.com/PyCQA/pycodestyle/issues/584 ignore = N802,E999,W503 - -[mypy] -python_version=3.6 - -show_column_numbers=True -show_error_context=False - -# suppress errors about unsatisfied imports -ignore_missing_imports=True - -# allow untyped calls as a consequence of the options above -disallow_untyped_calls=False - -# allow returning Any as a consequence of the options above -warn_return_any=False - -# treat Optional per PEP 484 -strict_optional=True - -# ensure all execution paths are returning -warn_no_return=True - -# lint-style cleanliness for typing needs to be disabled; returns more errors -# than the full run. -warn_redundant_casts=False -warn_unused_ignores=False - -# The following are off by default since they're too noisy. -# Flip them on if you feel adventurous. -disallow_untyped_defs=False -check_untyped_defs=False diff --git a/.pxl.flake8rc b/.pxl.flake8rc index 75780f49d43..15b047e69f9 100644 --- a/.pxl.flake8rc +++ b/.pxl.flake8rc @@ -5,34 +5,3 @@ max-line-length = 120 # E999: Mistaken error see https://github.com/PyCQA/pycodestyle/issues/584 # F821: Undefined name 'px'. We should fix this in pxl lang. ignore = N802,E999,F821,W503 - -[mypy] -python_version=3.6 - -show_column_numbers=True -show_error_context=False - -# suppress errors about unsatisfied imports -ignore_missing_imports=True - -# allow untyped calls as a consequence of the options above -disallow_untyped_calls=False - -# allow returning Any as a consequence of the options above -warn_return_any=False - -# treat Optional per PEP 484 -strict_optional=True - -# ensure all execution paths are returning -warn_no_return=True - -# lint-style cleanliness for typing needs to be disabled; returns more errors -# than the full run. -warn_redundant_casts=False -warn_unused_ignores=False - -# The following are off by default since they're too noisy. -# Flip them on if you feel adventurous. -disallow_untyped_defs=False -check_untyped_defs=False diff --git a/docker.properties b/docker.properties index 72fe1d263c3..3ecd16e2653 100644 --- a/docker.properties +++ b/docker.properties @@ -1,4 +1,4 @@ -DOCKER_IMAGE_TAG=202506270326 -LINTER_IMAGE_DIGEST=05aeeb210dec4b5753e55376aef7df013bb136a3ad70524fa1dff24f832b5c4e -DEV_IMAGE_DIGEST=f0a0c803733d6ad8c9104f745378ab9d7a95263a3f8882fc28f11c79c1200d1f -DEV_IMAGE_WITH_EXTRAS_DIGEST=17c8ce9c4bd4dba40cdd6e40bdee726237336dbd6581deca864ebe9302cff569 +DOCKER_IMAGE_TAG=202507242250 +LINTER_IMAGE_DIGEST=911f172364626f44efb61345517b5e7bb8c8ee8f065fcf3ba0a790ab1a88cdcb +DEV_IMAGE_DIGEST=08fc759c2b45078214be313335b8c3c23200aea54b9609e8c42fe367762e6c7c +DEV_IMAGE_WITH_EXTRAS_DIGEST=0ecefa696cfad238c432c2e213600263d00dda4ca4a427796f8fc16eb3d9bfc0 diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000000..67f8a7e5215 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,29 @@ +[mypy] +python_version = 3.8 +show_column_numbers = True +show_error_context = False + +# suppress errors about unsatisfied imports +ignore_missing_imports = True + +# allow untyped calls as a consequence of the options above +disallow_untyped_calls = False + +# allow returning Any as a consequence of the options above +warn_return_any = False + +# treat Optional per PEP 484 +strict_optional = True + +# ensure all execution paths are returning +warn_no_return = True + +# lint-style cleanliness for typing needs to be disabled; returns more errors +# than the full run. +warn_redundant_casts = False +warn_unused_ignores = False + +# The following are off by default since they're too noisy. +# Flip them on if you feel adventurous. +disallow_untyped_defs = False +check_untyped_defs = False diff --git a/tools/chef/cookbooks/px_dev/recipes/linters.rb b/tools/chef/cookbooks/px_dev/recipes/linters.rb index 27d5206b10f..0ec7775a9a1 100644 --- a/tools/chef/cookbooks/px_dev/recipes/linters.rb +++ b/tools/chef/cookbooks/px_dev/recipes/linters.rb @@ -26,7 +26,7 @@ end execute 'install py linters' do - command 'python3 -m pip install --break-system-packages flake8 flake8-mypy yamllint --no-cache-dir && python3 -m pip cache purge' + command 'python3 -m pip install --break-system-packages flake8 mypy yamllint --no-cache-dir && python3 -m pip cache purge' end common_remote_bin 'prototool'