Spaces:
Paused
Paused
File size: 692 Bytes
5e0b58b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """Quality gate for v0.5.0-alpha.4."""
from __future__ import annotations
import shutil
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def run(*args: str) -> None:
print("+", " ".join(args), flush=True)
subprocess.run(args, cwd=ROOT, check=True)
def main() -> int:
run(sys.executable, "-m", "pytest", "-v", "-m", "not slow")
if shutil.which("black"):
run("black", "--check", "src", "tests", "scripts")
if shutil.which("mypy"):
run("mypy", "src")
if shutil.which("pyright"):
run("pyright", "src", "scripts", "tests")
return 0
if __name__ == "__main__":
raise SystemExit(main())
|