MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / add_git_version

Function add_git_version

setup.py:20–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def add_git_version():
21
22 def get_git_version():
23 from subprocess import check_output
24 try:
25 return check_output("git describe --tags --long --dirty".split()).decode('utf-8').strip()
26 except Exception:
27 return __version__ # noqa
28
29 newlibinfo_content = [l for l in libinfo_content if not l.startswith('__git_version__')]
30 newlibinfo_content.append('__git_version__ = "{}"'.format(get_git_version()))
31 with open(libinfo_py, "w") as f:
32 f.write("".join(newlibinfo_content))
33
34
35add_git_version()

Callers 1

setup.pyFile · 0.85

Calls 4

get_git_versionFunction · 0.85
appendMethod · 0.80
formatMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected