MCPcopy
hub / github.com/saltstack/salt / parse

Method parse

salt/version.py:357–368  ·  view source on GitHub ↗
(cls, version_string)

Source from the content-addressed store, hash-verified

355
356 @classmethod
357 def parse(cls, version_string):
358 if version_string.lower() in cls.LNAMES:
359 return cls.from_name(version_string)
360 vstr = (
361 version_string.decode()
362 if isinstance(version_string, bytes)
363 else version_string
364 )
365 match = cls.git_describe_regex.match(vstr)
366 if not match:
367 raise ValueError(f"Unable to parse version string: '{version_string}'")
368 return cls(*match.groups())
369
370 @classmethod
371 def from_name(cls, name):

Callers 15

runMethod · 0.45
check_virtualFunction · 0.45
check_docstringsFunction · 0.45
check_cp1252_docstringsFunction · 0.45
check_inline_markupFunction · 0.45
_check_protoMethod · 0.45
is_cachedMethod · 0.45
cache_destMethod · 0.45
__compare__Method · 0.45
__discover_versionFunction · 0.45
__get_versionFunction · 0.45
version.pyFile · 0.45

Calls 2

from_nameMethod · 0.45
matchMethod · 0.45

Tested by 15

test_versionFunction · 0.36
test_editable_installFunction · 0.36
test_wheelFunction · 0.36
test_eggFunction · 0.36
test_sdistFunction · 0.36
test_setup_installFunction · 0.36
test_pkg_pathsFunction · 0.36
test_paths_log_rotationFunction · 0.36