_version.py 503 B

123456789101112131415161718
  1. """
  2. store the current version info of the server.
  3. """
  4. import re
  5. # Version string must appear intact for automatic versioning
  6. __version__ = "2.17.0"
  7. # Build up version_info tuple for backwards compatibility
  8. pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
  9. match = re.match(pattern, __version__)
  10. assert match is not None
  11. parts: list[object] = [int(match[part]) for part in ["major", "minor", "patch"]]
  12. if match["rest"]:
  13. parts.append(match["rest"])
  14. version_info = tuple(parts)