onnxruntime/cgmanifests/print_submodule_info.py
Justin Chu fdce4fa6af
Format all python files under onnxruntime with black and isort (#11324)
Description: Format all python files under onnxruntime with black and isort.

After checking in, we can use .git-blame-ignore-revs to ignore the formatting PR in git blame.

#11315, #11316
2022-04-26 09:35:16 -07:00

29 lines
556 B
Python

#!/usr/bin/env python3
# args: <submodule path>
# output: <path> <url> <commit>
import subprocess
import sys
assert len(sys.argv) == 2
path = sys.argv[1]
proc = subprocess.run(
["git", "config", "--get", "remote.origin.url"],
check=True,
cwd=path,
stdout=subprocess.PIPE,
universal_newlines=True,
)
url = proc.stdout.strip()
proc = subprocess.run(
["git", "rev-parse", "HEAD"], check=True, cwd=path, stdout=subprocess.PIPE, universal_newlines=True
)
commit = proc.stdout.strip()
print("{} {} {}".format(path, url, commit))