Files
FastDeploy/third_party/optimizer/tools/mypy-onnx.py
Jason 6343b0db47 [Build] Support build with source code of Paddle2ONNX (#1559)
* Add notes for tensors

* Optimize some apis

* move some warnings

* Support build with Paddle2ONNX

* Add protobuf support

* Fix compile on mac

* add clearn package script

* Add paddle2onnx code

* remove submodule

* Add onnx ocde

* remove softlink

* add onnx code

* fix error

* Add cmake file

* fix patchelf

* update paddle2onnx

* Delete .gitmodules

---------

Co-authored-by: PaddleCI <paddle_ci@example.com>
Co-authored-by: pangyoki <pangyoki@126.com>
Co-authored-by: jiangjiajun <jiangjiajun@baidu.lcom>
2023-03-17 10:03:22 +08:00

26 lines
592 B
Python

#!/usr/bin/env python
# SPDX-License-Identifier: Apache-2.0
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()