version.py 539 B

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