Parse 'x.y.z' into a comparable tuple. None if not parseable.
(v: str)
| 78 | |
| 79 | |
| 80 | def parse_semver(v: str) -> tuple[int, int, int] | None: |
| 81 | """Parse 'x.y.z' into a comparable tuple. None if not parseable.""" |
| 82 | parts = (v or "").split(".") |
| 83 | if len(parts) != 3: |
| 84 | return None |
| 85 | try: |
| 86 | return tuple(int(x) for x in parts) # type: ignore[return-value] |
| 87 | except ValueError: |
| 88 | return None |
| 89 | |
| 90 | |
| 91 | def patch_bump(v: str) -> str: |
no outgoing calls
no test coverage detected