mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
Add cgmanifest.json entries for training dependencies. Add script to generate git submodule cgmanifest.json entries.
29 lines
703 B
Python
29 lines
703 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))
|