diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-09-18 00:35:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 00:35:51 (GMT) |
commit | 54fbfa8d5e52ed315d10640c875a8b8dd2c30cec (patch) | |
tree | 7e0ea84e0e13eafdcb498377a95a6f975a79b0c1 | |
parent | a75daed7e004ee9a53b160307c4c072656176a02 (diff) | |
download | cpython-54fbfa8d5e52ed315d10640c875a8b8dd2c30cec.zip cpython-54fbfa8d5e52ed315d10640c875a8b8dd2c30cec.tar.gz cpython-54fbfa8d5e52ed315d10640c875a8b8dd2c30cec.tar.bz2 |
gh-109413: Improve mypy config for libregrtest (#109518)
Improve the mypy config file for libregrtest
-rw-r--r-- | Lib/test/libregrtest/mypy.ini | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/Lib/test/libregrtest/mypy.ini b/Lib/test/libregrtest/mypy.ini index ac2f70c..fefc347 100644 --- a/Lib/test/libregrtest/mypy.ini +++ b/Lib/test/libregrtest/mypy.ini @@ -1,12 +1,10 @@ # Config file for running mypy on libregrtest. -# -# Note: mypy can't be run on libregrtest from the CPython repo root. -# If you try to do so, mypy will complain -# about the entire `Lib/` directory "shadowing the stdlib". -# Instead, `cd` into `Lib/test`, then run `mypy --config-file libregrtest/mypy.ini`. +# Run mypy by invoking `mypy --config-file Lib/test/libregrtest/mypy.ini` +# on the command-line from the repo root [mypy] -packages = libregrtest +files = Lib/test/libregrtest +explicit_package_bases = True python_version = 3.11 platform = linux pretty = True @@ -17,7 +15,6 @@ strict = True # Various stricter settings that we can't yet enable # Try to enable these in the following order: -strict_optional = False disallow_any_generics = False disallow_incomplete_defs = False disallow_untyped_calls = False @@ -27,21 +24,10 @@ warn_return_any = False disable_error_code = return -# Various internal modules that typeshed deliberately doesn't have stubs for: -[mypy-_abc.*] -ignore_missing_imports = True - -[mypy-_opcode.*] -ignore_missing_imports = True - -[mypy-_overlapped.*] -ignore_missing_imports = True - -[mypy-_testcapi.*] -ignore_missing_imports = True - -[mypy-_testinternalcapi.*] -ignore_missing_imports = True +# Enable --strict-optional for these ASAP: +[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.*] +strict_optional = False -[mypy-test.*] +# Various internal modules that typeshed deliberately doesn't have stubs for: +[mypy-_abc.*,_opcode.*,_overlapped.*,_testcapi.*,_testinternalcapi.*,test.*] ignore_missing_imports = True |