_version.py 608 B

1234567891011121314151617181920
  1. """
  2. store the current version info of the server.
  3. """
  4. import re
  5. # Version string must appear intact for hatch versioning
  6. __version__ = "7.2.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)
  15. kernel_protocol_version_info = (5, 3)
  16. kernel_protocol_version = "{}.{}".format(*kernel_protocol_version_info)