MCPcopy Index your code
hub / github.com/prometheus/client_python / parse_version

Function parse_version

prometheus_client/utils.py:28–36  ·  view source on GitHub ↗
(version_str: str)

Source from the content-addressed store, hash-verified

26
27
28def parse_version(version_str: str) -> tuple[Union[int, str], ...]:
29 version: list[Union[int, str]] = []
30 for part in version_str.split('.'):
31 try:
32 version.append(int(part))
33 except ValueError:
34 version.append(part)
35
36 return tuple(version)

Callers 2

choose_encoderFunction · 0.85
generate_latestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected