(version: str)
| 33 | |
| 34 | # This is a patch applied to this library to allow specifying a deprecation version |
| 35 | def parse_version(version: str) -> tuple: |
| 36 | match = re.match(r"^(?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?", version) |
| 37 | if match is None: |
| 38 | return (0,0,0) |
| 39 | groups = match.groupdict() |
| 40 | return (int(groups['major']), int(groups['minor']), int(groups['patch'] or '0')) |
| 41 | |
| 42 | |
| 43 | class DeprecatedWarning(DeprecationWarning): |