MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_git_commit

Function get_git_commit

imperative/python/gen_version.py:5–9  ·  view source on GitHub ↗
(src_dir)

Source from the content-addressed store, hash-verified

3import subprocess
4
5def get_git_commit(src_dir):
6 try:
7 return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=src_dir).decode('ascii').strip()
8 except Exception:
9 return 'unknown'
10
11def get_mge_version(version_txt_path):
12 v = {}

Callers 1

gen_version.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected