Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/jupyter_core/version.py: 91%

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

11 statements  

1""" 

2store the current version info of the jupyter_core. 

3""" 

4 

5from __future__ import annotations 

6 

7import re 

8 

9# Version string must appear intact for hatch versioning 

10__version__ = "5.8.1" 

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)