MCPcopy Create free account
hub / github.com/ceph/ceph / parse_version

Function parse_version

qa/workunits/dencoder/test_readable.py:135–148  ·  view source on GitHub ↗

Parse a version string into a tuple of integers, ignoring suffixes. Args: version (str): The version string to parse. Returns: tuple: A tuple of integers representing the version.

(version)

Source from the content-addressed store, hash-verified

133 return (_numtests, _failed, unrecognized)
134
135def parse_version(version):
136 """
137 Parse a version string into a tuple of integers, ignoring suffixes.
138
139 Args:
140 version (str): The version string to parse.
141
142 Returns:
143 tuple: A tuple of integers representing the version.
144 """
145 numeric_part = re.match(r'(\d+(\.\d+)*).*', version)
146 if numeric_part:
147 return tuple(map(int, numeric_part.group(1).split('.')))
148 raise ValueError(f"Invalid version format: {version}")
149
150
151def should_skip_object(type, arversion, current_ver):

Callers 2

should_skip_objectFunction · 0.85
decode_jsonMethod · 0.85

Calls 4

tupleClass · 0.85
matchMethod · 0.45
splitMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected