Optional pytype install on Windows (no CI) (#12669)

This commit is contained in:
Avasam
2024-09-17 04:58:31 -04:00
committed by GitHub
parent 3266319a76
commit d34ef50754
8 changed files with 33 additions and 37 deletions

View File

@@ -7,6 +7,7 @@ import os
import re
import subprocess
import sys
from importlib.util import find_spec
from pathlib import Path
from typing import Any
@@ -127,11 +128,11 @@ def main() -> None:
else:
print(colored("\nSkipping stubtest since mypy failed.", "yellow"))
if sys.platform == "win32":
print(colored("\nSkipping pytype on Windows. You can run the test with WSL.", "yellow"))
else:
if find_spec("pytype"):
print("\nRunning pytype...")
pytype_result = subprocess.run([sys.executable, "tests/pytype_test.py", path])
else:
print(colored("\nSkipping pytype on Windows. You need to install it first: `pip install pytype`.", "yellow"))
cases_path = test_cases_path(stub if folder == "stubs" else "stdlib")
if not cases_path.exists():