MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / read_versions

Function read_versions

deploy.py:16–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15
16def read_versions() -> Tuple[str, str]:
17 init_path = ROOT / "MCSL2Lib" / "__init__.py"
18 values: Dict[str, str] = {}
19 for node in ast.parse(init_path.read_text(encoding="utf-8")).body:
20 if not isinstance(node, ast.Assign) or len(node.targets) != 1:
21 continue
22 target = node.targets[0]
23 if isinstance(target, ast.Name) and target.id in {"VERSION", "BUILD_VERSION"}:
24 value = ast.literal_eval(node.value)
25 if isinstance(value, str):
26 values[target.id] = value
27 return values.get("VERSION", "2.0"), values.get("BUILD_VERSION", "0.3")
28
29
30def build_args(extra_args: List[str]) -> List[str]:

Callers 1

build_argsFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected