]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-142859: Add `Tools/check-c-api-docs` to mypy check (GH-142860) (#142871)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 17 Dec 2025 11:50:22 +0000 (12:50 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Dec 2025 11:50:22 +0000 (11:50 +0000)
gh-142859: Add `Tools/check-c-api-docs` to mypy check (GH-142860)
(cherry picked from commit 248eb3efb3cad7799ef9b4a2dd77a66d1ae65c11)

Co-authored-by: sobolevn <mail@sobolevn.me>
.github/workflows/mypy.yml
Tools/check-c-api-docs/mypy.ini [new file with mode: 0644]

index 5d5d77f29f6eb1ebbf6518aad1ea439795699689..f821cdf1f6fbc8b7aa39a07de0c0d7259e117ffb 100644 (file)
@@ -25,6 +25,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/**"
@@ -57,6 +58,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,