summaryrefslogtreecommitdiff
path: root/run_mypy.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-11-26 02:17:50 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-11-26 17:12:52 -0500
commitcf64e062bb6f8d95c73a6b292629a7776ff31864 (patch)
tree889267bb6f272e7976afceef0b29fef14c4748d2 /run_mypy.py
parent739bdef431eca44ed12db882f3096c655725b87d (diff)
downloadmeson-cf64e062bb6f8d95c73a6b292629a7776ff31864.tar.gz
run_mypy: avoid type-checking tools against every possible python version
Diffstat (limited to 'run_mypy.py')
-rwxr-xr-xrun_mypy.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/run_mypy.py b/run_mypy.py
index 16ff318e8..25dc1d568 100755
--- a/run_mypy.py
+++ b/run_mypy.py
@@ -69,7 +69,8 @@ modules = [
'mesonbuild/mtest.py',
'mesonbuild/optinterpreter.py',
'mesonbuild/programs.py',
-
+]
+additional = [
'run_mypy.py',
'run_project_tests.py',
'run_single_test.py',
@@ -115,23 +116,29 @@ def main() -> int:
print('\x1bc', end='', flush=True)
to_check = [] # type: T.List[str]
+ additional_to_check = [] # type: T.List[str]
if opts.files:
for f in opts.files:
if f in modules:
to_check.append(f)
elif any(f.startswith(i) for i in modules):
to_check.append(f)
+ elif f in additional:
+ additional_to_check.append(f)
+ elif any(f.startswith(i) for i in additional):
+ additional_to_check.append(f)
else:
if not opts.quiet:
print(f'skipping {f!r} because it is not yet typed')
else:
to_check.extend(modules)
+ additional_to_check.extend(additional)
if to_check:
command = [opts.mypy] if opts.mypy else [sys.executable, '-m', 'mypy']
if not opts.quiet:
print('Running mypy (this can take some time) ...')
- retcode = subprocess.run(command + args + to_check, cwd=root).returncode
+ retcode = subprocess.run(command + args + to_check + additional_to_check, cwd=root).returncode
if opts.allver and retcode == 0:
for minor in range(7, sys.version_info[1]):
if not opts.quiet: