MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _compute_versions

Function _compute_versions

tasks/scripts/release.py:137–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135
136
137def _compute_versions() -> Versions:
138 git_tag = _latest_semver_tag()
139 git_sha = _git(["rev-parse", "--short=9", "HEAD"])
140
141 if git_tag is None:
142 base_version = (0, 0, 0)
143 git_distance = int(_git(["rev-list", "--count", "HEAD"]))
144 return _versions_from_parts(base_version, git_distance, git_sha, "")
145
146 parsed_tag = _parse_semver_tag(git_tag)
147 if parsed_tag is None:
148 raise RuntimeError(f"invalid semantic release tag: {git_tag}")
149
150 git_distance = int(_git(["rev-list", f"{git_tag}..HEAD", "--count"]))
151 return _versions_from_parts(parsed_tag, git_distance, git_sha, git_tag)
152
153
154def _print_env(versions: Versions) -> None:

Callers 1

get_versionFunction · 0.85

Calls 4

_latest_semver_tagFunction · 0.85
_gitFunction · 0.85
_versions_from_partsFunction · 0.85
_parse_semver_tagFunction · 0.85

Tested by

no test coverage detected