MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / msi_version

Function msi_version

scripts/update_installer.py:38–47  ·  view source on GitHub ↗
(raw: str)

Source from the content-addressed store, hash-verified

36
37
38def msi_version(raw: str) -> str:
39 # AdvancedInstaller's ProductVersion only accepts numeric X[.Y[.Z[.B]]].
40 # Strip Python-style suffixes ("0.7-dev0" -> "0.7"; "1.0.0-rc1" -> "1.0.0")
41 # and pad to three components so the resulting MSI filename is consistent.
42 parts = [re.split(r"[^\d]", p, maxsplit=1)[0] for p in raw.split(".")]
43 if not all(p.isdigit() for p in parts if p):
44 sys.exit(f"Cannot derive numeric MSI version from {raw!r}")
45 while len(parts) < 3:
46 parts.append("0")
47 return ".".join(parts[:4])
48
49
50def find_advinst() -> Path:

Callers 2

pre_release.pyFile · 0.90
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected