Skip to content

Commit 54fbfa8

Browse files
authored
gh-109413: Improve mypy config for libregrtest (#109518)
Improve the mypy config file for libregrtest
1 parent a75daed commit 54fbfa8

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

Lib/test/libregrtest/mypy.ini

+9-23
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Config file for running mypy on libregrtest.
2-
#
3-
# Note: mypy can't be run on libregrtest from the CPython repo root.
4-
# If you try to do so, mypy will complain
5-
# about the entire `Lib/` directory "shadowing the stdlib".
6-
# Instead, `cd` into `Lib/test`, then run `mypy --config-file libregrtest/mypy.ini`.
2+
# Run mypy by invoking `mypy --config-file Lib/test/libregrtest/mypy.ini`
3+
# on the command-line from the repo root
74

85
[mypy]
9-
packages = libregrtest
6+
files = Lib/test/libregrtest
7+
explicit_package_bases = True
108
python_version = 3.11
119
platform = linux
1210
pretty = True
@@ -17,7 +15,6 @@ strict = True
1715

1816
# Various stricter settings that we can't yet enable
1917
# Try to enable these in the following order:
20-
strict_optional = False
2118
disallow_any_generics = False
2219
disallow_incomplete_defs = False
2320
disallow_untyped_calls = False
@@ -27,21 +24,10 @@ warn_return_any = False
2724

2825
disable_error_code = return
2926

30-
# Various internal modules that typeshed deliberately doesn't have stubs for:
31-
[mypy-_abc.*]
32-
ignore_missing_imports = True
33-
34-
[mypy-_opcode.*]
35-
ignore_missing_imports = True
36-
37-
[mypy-_overlapped.*]
38-
ignore_missing_imports = True
39-
40-
[mypy-_testcapi.*]
41-
ignore_missing_imports = True
42-
43-
[mypy-_testinternalcapi.*]
44-
ignore_missing_imports = True
27+
# Enable --strict-optional for these ASAP:
28+
[mypy-Lib.test.libregrtest.main.*,Lib.test.libregrtest.run_workers.*,Lib.test.libregrtest.worker.*,Lib.test.libregrtest.single.*,Lib.test.libregrtest.results.*,Lib.test.libregrtest.utils.*]
29+
strict_optional = False
4530

46-
[mypy-test.*]
31+
# Various internal modules that typeshed deliberately doesn't have stubs for:
32+
[mypy-_abc.*,_opcode.*,_overlapped.*,_testcapi.*,_testinternalcapi.*,test.*]
4733
ignore_missing_imports = True

0 commit comments

Comments
 (0)