]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142859: Add `Tools/check-c-api-docs` to mypy check (#142860)
authorsobolevn <mail@sobolevn.me>
Wed, 17 Dec 2025 11:23:30 +0000 (14:23 +0300)
committerGitHub <noreply@github.com>
Wed, 17 Dec 2025 11:23:30 +0000 (13:23 +0200)
.github/workflows/mypy.yml
Tools/check-c-api-docs/mypy.ini [new file with mode: 0644]

index fac0fa8aba3050473beea4240920f26d56267a9d..8810730e193bb63fc08c2691bd26d5f3da5bf4a6 100644 (file)
@@ -26,6 +26,7 @@ on:
       - "Tools/build/update_file.py"
       - "Tools/build/verify_ensurepip_wheels.py"
       - "Tools/cases_generator/**"
+      - "Tools/check-c-api-docs/**"
       - "Tools/clinic/**"
       - "Tools/jit/**"
       - "Tools/peg_generator/**"
@@ -58,6 +59,7 @@ jobs:
           "Lib/tomllib",
           "Tools/build",
           "Tools/cases_generator",
+          "Tools/check-c-api-docs",
           "Tools/clinic",
           "Tools/jit",
           "Tools/peg_generator",
diff --git a/Tools/check-c-api-docs/mypy.ini b/Tools/check-c-api-docs/mypy.ini
new file mode 100644 (file)
index 0000000..f42eb28
--- /dev/null
@@ -0,0 +1,19 @@
+[mypy]
+files = Tools/check-c-api-docs/
+pretty = True
+
+# We need `_colorize` import:
+mypy_path = $MYPY_CONFIG_FILE_DIR/../../Misc/mypy
+
+# Make sure Python can still be built
+# using Python 3.13 for `PYTHON_FOR_REGEN`...
+python_version = 3.13
+
+# ...And be strict:
+strict = True
+extra_checks = True
+enable_error_code = 
+    ignore-without-code,
+    redundant-expr,
+    truthy-bool,
+    possibly-undefined,