_version.py 463 B

1234567891011121314151617
  1. """Version info."""
  2. from __future__ import annotations
  3. import re
  4. __version__ = "0.10.4"
  5. # Build up version_info tuple for backwards compatibility
  6. pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
  7. match = re.match(pattern, __version__)
  8. if match:
  9. parts: list[int | str] = [int(match[part]) for part in ["major", "minor", "patch"]]
  10. if match["rest"]:
  11. parts.append(match["rest"])
  12. else:
  13. parts = []
  14. version_info = tuple(parts)