Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/ipykernel/_version.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

13 statements  

1""" 

2store the current version info of the server. 

3""" 

4 

5from __future__ import annotations 

6 

7import re 

8 

9# Version string must appear intact for hatch versioning 

10__version__ = "7.0.0a1" 

11 

12# Build up version_info tuple for backwards compatibility 

13pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)" 

14match = re.match(pattern, __version__) 

15assert match is not None 

16parts: list[object] = [int(match[part]) for part in ["major", "minor", "patch"]] 

17if match["rest"]: 

18 parts.append(match["rest"]) 

19version_info = tuple(parts) 

20 

21kernel_protocol_version_info = (5, 3) 

22kernel_protocol_version = "{}.{}".format(*kernel_protocol_version_info)