Skip to content

Commit 248eb3e

Browse files
authored
gh-142859: Add Tools/check-c-api-docs to mypy check (#142860)
1 parent 1e9a0ee commit 248eb3e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
- "Tools/build/update_file.py"
2727
- "Tools/build/verify_ensurepip_wheels.py"
2828
- "Tools/cases_generator/**"
29+
- "Tools/check-c-api-docs/**"
2930
- "Tools/clinic/**"
3031
- "Tools/jit/**"
3132
- "Tools/peg_generator/**"
@@ -58,6 +59,7 @@ jobs:
5859
"Lib/tomllib",
5960
"Tools/build",
6061
"Tools/cases_generator",
62+
"Tools/check-c-api-docs",
6163
"Tools/clinic",
6264
"Tools/jit",
6365
"Tools/peg_generator",

Tools/check-c-api-docs/mypy.ini

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[mypy]
2+
files = Tools/check-c-api-docs/
3+
pretty = True
4+
5+
# We need `_colorize` import:
6+
mypy_path = $MYPY_CONFIG_FILE_DIR/../../Misc/mypy
7+
8+
# Make sure Python can still be built
9+
# using Python 3.13 for `PYTHON_FOR_REGEN`...
10+
python_version = 3.13
11+
12+
# ...And be strict:
13+
strict = True
14+
extra_checks = True
15+
enable_error_code =
16+
ignore-without-code,
17+
redundant-expr,
18+
truthy-bool,
19+
possibly-undefined,

0 commit comments

Comments
 (0)