Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8c6c7ac
Script to run all checks locally
Avasam Sep 27, 2022
da2191e
missing return types
Avasam Sep 27, 2022
e3d293f
Apply suggestions from code review
Avasam Sep 27, 2022
9a0757c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2022
850d7fa
summary
Avasam Sep 27, 2022
9f92d0f
Merge branch 'run-all-checks-single-script' of https://github.com/Ava…
Avasam Sep 27, 2022
60f3f86
skip pyright if no npx
Avasam Sep 27, 2022
6b0544d
mypy type ignore
Avasam Sep 27, 2022
dc9d4eb
"Skipping" message
Avasam Sep 27, 2022
0241da0
mypy false positive
Avasam Sep 27, 2022
6ad47a3
rename
Avasam Sep 27, 2022
994173a
explicit CompletedProcess type because mypy
Avasam Sep 27, 2022
69c8bd8
Merge branch 'master' into run-all-checks-single-script
AlexWaygood Sep 28, 2022
36aaf68
mention in readme
Avasam Sep 28, 2022
80bc8c7
Apply suggestions from code review
Avasam Sep 28, 2022
430f855
Merge branch 'run-all-checks-single-script' of https://github.com/Ava…
Avasam Sep 28, 2022
169ad68
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2022
7aa69d3
annotations
Avasam Sep 28, 2022
901a4ad
Merge branch 'run-all-checks-single-script' of https://github.com/Ava…
Avasam Sep 28, 2022
f02191e
obsolete comment
Avasam Sep 28, 2022
31a3c10
PR comments
Avasam Sep 29, 2022
22b6cc9
Merge branch 'master' of https://github.com/python/typeshed into run-…
Avasam Sep 29, 2022
4ff0c8d
Merge branch 'master' of https://github.com/python/typeshed into run-…
Avasam Oct 1, 2022
77a3c9b
Set python version and better output
Avasam Oct 1, 2022
e8e1c43
Typed main
Avasam Oct 1, 2022
024e696
mention venv bug
Avasam Oct 2, 2022
3ceb0d3
output update
Avasam Oct 2, 2022
f9f3154
revert debug change
Avasam Oct 2, 2022
fad18bf
Update tests/README.md
Avasam Oct 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip pyright if no npx
  • Loading branch information
Avasam committed Sep 27, 2022
commit 60f3f86d6aac255b1c572ea7e27d8a7e27d66e94
28 changes: 19 additions & 9 deletions scripts/run_all_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _get_strict_params(stub_path: str) -> list[str]:
try:
path = sys.argv[1]
except IndexError:
print("Missing path argument in format <folder>/<stub>")
print("Missing path argument in format <folder>/<stub>", file=sys.stderr)
sys.exit(1)
path_tokens = Path(path).parts
assert len(path_tokens) == 2, "Path argument should be in format <folder>/<stub>"
Expand All @@ -58,7 +58,14 @@ def _get_strict_params(stub_path: str) -> list[str]:
check_consistent_result = subprocess.run(["python3", "tests/check_consistent.py"])
check_new_syntax_result = subprocess.run(["python3", "tests/check_new_syntax.py"])

pyright_result = subprocess.run(["python3", "tests/pyright_test.py", path] + _get_strict_params(path))
pyright_result = subprocess.run(["python3", "tests/pyright_test.py", path] + _get_strict_params(path), stderr=subprocess.PIPE)
print(pyright_result.stderr.decode())
if b"error running npx" in pyright_result.stderr:
pyright_returncode = 0
pyright_skipped = True
else:
pyright_returncode = pyright_result.returncode
pyright_skipped = False

mypy_result = subprocess.run(["python3", "tests/mypy_test.py", path])
# If mypy failed, stubtest will fail without any helpful error
Expand All @@ -84,7 +91,7 @@ def _get_strict_params(stub_path: str) -> list[str]:
flake8_result.returncode
+ check_consistent_result.returncode
+ check_new_syntax_result.returncode
+ pyright_result.returncode
+ pyright_returncode
+ mypy_result.returncode
+ (stubtest_result.returncode if stubtest_result else 0)
+ (pytype_result.returncode if pytype_result else 0)
Expand All @@ -99,16 +106,19 @@ def _get_strict_params(stub_path: str) -> list[str]:
print("flake8:", _SUCCESS if flake8_result.returncode == 0 else _FAILED)
print("Check consistent:", _SUCCESS if check_consistent_result.returncode == 0 else _FAILED)
print("Check new syntax:", _SUCCESS if check_new_syntax_result.returncode == 0 else _FAILED)
print("pyright:", _SUCCESS if pyright_result.returncode == 0 else _FAILED)
print("mypy:", _SUCCESS if mypy_result.returncode == 0 else _FAILED)
if stubtest_result is not None:
print("stubtest:", _SUCCESS if stubtest_result.returncode == 0 else _FAILED)
if pyright_skipped:
print("pyright:", _SKIPPED)
else:
print("pyright:", _SUCCESS if pyright_returncode == 0 else _FAILED)
print("mypy:", _SUCCESS if mypy_result.returncode == 0 else _FAILED)
if stubtest_result is None:
print("stubtest:", _SKIPPED)
if pytype_result is not None:
print("pytype:", _SUCCESS if pytype_result.returncode == 0 else _FAILED)
else:
print("stubtest:", _SUCCESS if stubtest_result.returncode == 0 else _FAILED)
if pytype_result is None:
print("pytype:", _SKIPPED)
else:
print("pytype:", _SUCCESS if pytype_result.returncode == 0 else _FAILED)
print("Regression test:", _SUCCESS if regr_test_returncode == 0 else _FAILED)

sys.exit(int(any_failure))