1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/usr/bin/env python
import subprocess
import os
def main(): # type: () -> None
try:
root_folder = os.path.realpath(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.chdir(root_folder)
subprocess.check_call(["mypy", "."])
subprocess.check_call(["mypy", "--py2", "."])
exit(0)
except subprocess.CalledProcessError:
# Catch this exception because we don't want it to output a backtrace that would clutter the mypy output
exit(1)
if __name__ == '__main__':
main()
|