File: mypy-onnx.py

package info (click to toggle)
onnx 1.7.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 28,940 kB
  • sloc: cpp: 29,203; python: 20,948; ansic: 3,441; makefile: 26; sh: 26
file content (22 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
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()