mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-13 13:06:36 +03:00
e4d88e061d
Python is likely to be installed when working on Python code, which should make it more portable and consistent.
23 lines
510 B
Python
23 lines
510 B
Python
"""
|
|
Sort imports, format code, type-check and run offline tests.
|
|
"""
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def run(*args: str) -> int:
|
|
return subprocess.run((sys.executable, "-m", *args)).returncode
|
|
|
|
|
|
def main() -> None:
|
|
exit(
|
|
run("isort", ".", "--profile", "black", "--gitignore")
|
|
or run("black", ".", "--extend-exclude", r"tl/(abcs|functions|types)/\w+.py")
|
|
or run("mypy", "--strict", ".")
|
|
or run("pytest", ".", "-m", "not net")
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|