From bc56d8443eaa50525b94087fb5ec5ac05a538c59 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 19 Sep 2025 00:12:49 +0700 Subject: [PATCH 1/4] Update runtests.py: add selfc --- runtests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtests.py b/runtests.py index 3f49107f3ce0..f6b8b0bf7052 100755 --- a/runtests.py +++ b/runtests.py @@ -65,6 +65,17 @@ "-p", "mypyc", ], + # Self type check, but use mypyc; + # for instance, to catch nasty mypyc bugs. + "selfc": [ + "mypyc", + "--config-file", + "mypy_self_check.ini", + "-p", + "mypy", + "-p", + "mypyc", + ], # Type check setup.py as well "self-packaging": [ executable, From 6981a393a205306bcf11c52cdf2caa98071d480a Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 19 Sep 2025 00:13:47 +0700 Subject: [PATCH 2/4] black --- runtests.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/runtests.py b/runtests.py index f6b8b0bf7052..470774fa6d29 100755 --- a/runtests.py +++ b/runtests.py @@ -67,15 +67,7 @@ ], # Self type check, but use mypyc; # for instance, to catch nasty mypyc bugs. - "selfc": [ - "mypyc", - "--config-file", - "mypy_self_check.ini", - "-p", - "mypy", - "-p", - "mypyc", - ], + "selfc": ["mypyc", "--config-file", "mypy_self_check.ini", "-p", "mypy", "-p", "mypyc"], # Type check setup.py as well "self-packaging": [ executable, From f6b990a8ccf163efacb9a03640cdc428041f5924 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 19 Sep 2025 00:36:02 +0700 Subject: [PATCH 3/4] add selfc to slow, improve slow listing --- runtests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index 470774fa6d29..f2831289401e 100755 --- a/runtests.py +++ b/runtests.py @@ -106,7 +106,7 @@ # Stop run immediately if these commands fail FAST_FAIL = ["self", "lint"] -EXTRA_COMMANDS = ("pytest-extra", "mypyc-fast", "mypyc-extra") +EXTRA_COMMANDS = ("pytest-extra", "mypyc-fast", "mypyc-extra", "selfc") DEFAULT_COMMANDS = [cmd for cmd in cmds if cmd not in EXTRA_COMMANDS] assert all(cmd in cmds for cmd in FAST_FAIL) @@ -162,7 +162,7 @@ def main() -> None: print() print( "Run the given tests. If given no arguments, run everything except" - + " pytest-extra and mypyc-extra. Unrecognized arguments will be" + + f" the slowest commands {EXTRA_COMMANDS}. Unrecognized arguments will be" + " interpreted as individual test names / substring expressions" + " (or, if they end in .test, individual test files)" + " and this script will try to run them." From d5fd9d8e47ef0fae052abf2a3497cbe4f033a5e7 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 19 Sep 2025 16:46:22 +0700 Subject: [PATCH 4/4] refactor out the common args of self and selfc --- runtests.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/runtests.py b/runtests.py index f2831289401e..ff79befc4e52 100755 --- a/runtests.py +++ b/runtests.py @@ -48,26 +48,17 @@ # These mypyc test filters cover most slow test cases MYPYC_SLOW = [MYPYC_RUN_MULTI, MYPYC_COMMAND_LINE, MYPYC_SEPARATE, MYPYC_MULTIMODULE] +self_args = ["--config-file", "mypy_self_check.ini", "-p", "mypy", "-p", "mypyc"] # We split the pytest run into three parts to improve test # parallelization. Each run should have tests that each take a roughly similar # time to run. cmds = { # Self type check - "self": [ - executable, - "-m", - "mypy", - "--config-file", - "mypy_self_check.ini", - "-p", - "mypy", - "-p", - "mypyc", - ], + "self": [executable, "-m", "mypy"] + self_args, # Self type check, but use mypyc; # for instance, to catch nasty mypyc bugs. - "selfc": ["mypyc", "--config-file", "mypy_self_check.ini", "-p", "mypy", "-p", "mypyc"], + "selfc": ["mypyc"] + self_args, # Type check setup.py as well "self-packaging": [ executable,