From 6b8d4d64d80210f63c56ffc11f3fa16f4baca26e Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:03:36 +0100 Subject: [PATCH 1/3] Fix MyPy error Unused "type: ignore" comment [unused-ignore] --- distutils/compilers/C/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distutils/compilers/C/base.py b/distutils/compilers/C/base.py index 4159feae..84bbf322 100644 --- a/distutils/compilers/C/base.py +++ b/distutils/compilers/C/base.py @@ -70,7 +70,7 @@ class Compiler: # dictionary (see below -- used by the 'new_compiler()' factory # function) -- authors of new compiler interface classes are # responsible for updating 'compiler_class'! - compiler_type: ClassVar[str] = None # type: ignore[assignment] + compiler_type: ClassVar[str] = None # XXX things not handled by this compiler abstraction model: # * client can't provide additional options for a compiler, From 4bfa5c12ec1d9f44a9573f642389a449de29ade6 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:39:19 +0100 Subject: [PATCH 2/3] Update legacy hook ruff (legacy alias)......................................................Passed --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 633e3648..46da7fc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.9 + rev: v0.15.6 hooks: - - id: ruff + - id: ruff-check args: [--fix, --unsafe-fixes] - id: ruff-format From 82f0fa2ef1edd2fd8b350ca36868ab08732d4567 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:40:03 +0100 Subject: [PATCH 3/3] Run `ruff format` --- distutils/compilers/C/msvc.py | 3 ++- distutils/compilers/C/tests/test_base.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/distutils/compilers/C/msvc.py b/distutils/compilers/C/msvc.py index 1f50fa50..a2ea3ce0 100644 --- a/distutils/compilers/C/msvc.py +++ b/distutils/compilers/C/msvc.py @@ -95,7 +95,8 @@ def _find_vc2017(): subprocess.CalledProcessError, OSError, UnicodeDecodeError ): path = ( - subprocess.check_output([ + subprocess + .check_output([ os.path.join( root, "Microsoft Visual Studio", "Installer", "vswhere.exe" ), diff --git a/distutils/compilers/C/tests/test_base.py b/distutils/compilers/C/tests/test_base.py index a762e2b6..64a17364 100644 --- a/distutils/compilers/C/tests/test_base.py +++ b/distutils/compilers/C/tests/test_base.py @@ -18,7 +18,8 @@ def c_file(tmp_path): all_headers = gen_headers + plat_headers headers = '\n'.join(f'#include <{header}>\n' for header in all_headers) payload = ( - textwrap.dedent( + textwrap + .dedent( """ #headers void PyInit_foo(void) {}