MCPcopy
hub / github.com/pex-tool/pex / describe_rev

Function describe_rev

scripts/create-packages.py:193–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191
192
193def describe_rev() -> str:
194 if not os.path.isdir(".git") and os.path.isfile("PKG-INFO"):
195 # We're being build from an unpacked sdist.
196 with open("PKG-INFO") as fp:
197 return Parser().parse(fp).get("Version", "Unknown Version")
198
199 git_describe = subprocess.run(
200 ["git", "describe"], check=True, stdout=subprocess.PIPE, encoding="utf-8"
201 )
202 return git_describe.stdout.strip()
203
204
205def describe_file(path: Path) -> Tuple[str, int]:

Callers 1

mainFunction · 0.85

Calls 4

stripMethod · 0.80
getMethod · 0.45
parseMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected