MCPcopy Create free account
hub / github.com/Fadi002/de4py / parse_version

Function parse_version

de4py/utils/version.py:14–25  ·  view source on GitHub ↗
(v: str)

Source from the content-addressed store, hash-verified

12
13
14def parse_version(v: str) -> Tuple[int, int, int]:
15 cleaned = v.strip().lstrip('Vv')
16 parts = re.split(r'[.\-]', cleaned)
17 nums = []
18 for p in parts[:3]:
19 try:
20 nums.append(int(p))
21 except ValueError:
22 nums.append(0)
23 while len(nums) < 3:
24 nums.append(0)
25 return tuple(nums)
26
27
28def is_newer(remote: str, local: str) -> bool:

Callers 3

runMethod · 0.90
is_newerFunction · 0.85
versions_equalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected