MCPcopy Create free account
hub / github.com/apache/kvrocks / check_version

Function check_version

x.py:85–96  ·  view source on GitHub ↗
(current: str, required: Tuple[int, int, int], prog_name: Optional[str] = None)

Source from the content-addressed store, hash-verified

83
84
85def check_version(current: str, required: Tuple[int, int, int], prog_name: Optional[str] = None) -> Tuple[
86 int, int, int]:
87 require_version = '.'.join(map(str, required))
88 semver_match = SEMVER_REGEX.match(current)
89 if semver_match is None:
90 raise RuntimeError(f"{prog_name} {require_version} or higher is required, got: {current}")
91 semver_dict = semver_match.groupdict()
92 semver = (int(semver_dict["major"]), int(semver_dict["minor"]), int(semver_dict["patch"]))
93 if semver < required:
94 raise RuntimeError(f"{prog_name} {require_version} or higher is required, got: {current}")
95
96 return semver
97
98def prepare() -> None:
99 basedir = Path(__file__).parent.absolute()

Callers 4

buildFunction · 0.85
clang_formatFunction · 0.85
clang_tidyFunction · 0.85
golangci_lintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected