MCPcopy
hub / github.com/google/osv.dev / from_string

Method from_string

osv/ecosystems/pub.py:60–66  ·  view source on GitHub ↗
(cls, str_version)

Source from the content-addressed store, hash-verified

58
59 @classmethod
60 def from_string(cls, str_version):
61 # If version is not valid, it is most likely an invalid input
62 # version then sort it to the last/largest element
63 try:
64 return Version(semver_index.parse(str_version))
65 except ValueError:
66 return Version(semver_index.parse('999999'))
67
68
69class Pub(EnumerableEcosystem):

Callers 15

parse_purlFunction · 0.45
sort_keyMethod · 0.45
sort_keyMethod · 0.45
sort_keyMethod · 0.45
check_versions_orderMethod · 0.45
check_versions_equalMethod · 0.45
test_normalizeMethod · 0.45
test_sortMethod · 0.45
test_version_ge_leMethod · 0.45
check_orderMethod · 0.45
sort_keyMethod · 0.45
test_comparisonMethod · 0.45

Calls 2

parseMethod · 0.80
VersionClass · 0.70

Tested by 11

check_versions_orderMethod · 0.36
check_versions_equalMethod · 0.36
test_normalizeMethod · 0.36
test_sortMethod · 0.36
test_version_ge_leMethod · 0.36
check_orderMethod · 0.36
test_comparisonMethod · 0.36
check_version_equalsMethod · 0.36
test_ge_leMethod · 0.36
test_parseMethod · 0.36
test_empty_identifierMethod · 0.36