2023-09-03 12:00:48 +03:00
|
|
|
"""
|
2023-09-13 21:15:49 +03:00
|
|
|
Check formatting, type-check and run offline tests.
|
2023-09-03 12:00:48 +03:00
|
|
|
"""
|
2024-10-06 21:05:11 +03:00
|
|
|
|
2023-09-03 12:00:48 +03:00
|
|
|
import subprocess
|
|
|
|
import sys
|
2023-09-13 21:15:49 +03:00
|
|
|
import tempfile
|
|
|
|
|
|
|
|
BLACK_IGNORE = r"tl/(abcs|functions|types)/\w+.py"
|
2023-09-03 12:00:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
def run(*args: str) -> int:
|
|
|
|
return subprocess.run((sys.executable, "-m", *args)).returncode
|
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
2023-09-13 21:15:49 +03:00
|
|
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
|
|
exit(
|
2024-10-06 21:05:11 +03:00
|
|
|
run("mypy", "--strict", ".")
|
2023-10-12 19:17:41 +03:00
|
|
|
or run("ruff", "check", ".")
|
2023-09-14 22:17:24 +03:00
|
|
|
or run("sphinx", "-M", "dummy", "client/doc", tmp_dir, "-n", "-W")
|
2023-09-13 21:15:49 +03:00
|
|
|
or run("pytest", ".", "-m", "not net")
|
|
|
|
)
|
2023-09-03 12:00:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|