Skip to content

Commit b952ab0

Browse files
committed
add pathlib to Misc/mypy tests
1 parent 965c3c7 commit b952ab0

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/mypy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
matrix:
4242
target: [
4343
"Lib/_pyrepl",
44+
"Lib/pathlib",
4445
"Lib/test/libregrtest",
4546
"Tools/build",
4647
"Tools/cases_generator",

Lib/pathlib/mypy.ini

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Config file for running mypy on pathlib.
2+
# Run mypy by invoking `mypy --config-file Lib/pathlib/mypy.ini`
3+
# on the command-line from the repo root
4+
5+
[mypy]
6+
files = Lib/pathlib
7+
mypy_path = $MYPY_CONFIG_FILE_DIR/../../Misc/mypy
8+
explicit_package_bases = True
9+
python_version = 3.13
10+
platform = linux
11+
pretty = True
12+
13+
# ... Enable most stricter settings
14+
enable_error_code = ignore-without-code,redundant-expr
15+
strict = True
16+
17+
# can't enable before glob isn't typed ...
18+
warn_return_any = False
19+
disable_error_code = attr-defined
20+
21+
# Various stricter settings that we can't yet enable
22+
# Try to enable these in the following order:
23+
disallow_untyped_calls = False
24+
disallow_untyped_defs = False
25+
check_untyped_defs = False

Misc/mypy/pathlib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Lib/pathlib

Misc/mypy/typed-stdlib.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
_colorize.py
44
_pyrepl
5+
pathlib

0 commit comments

Comments
 (0)