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

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

12 statements  

1"""Version info.""" 

2from __future__ import annotations 

3 

4import re 

5 

6__version__ = "0.10.2" 

7 

8# Build up version_info tuple for backwards compatibility 

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

10match = re.match(pattern, __version__) 

11if match: 

12 parts: list[int | str] = [int(match[part]) for part in ["major", "minor", "patch"]] 

13 if match["rest"]: 

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

15else: 

16 parts = [] 

17version_info = tuple(parts)