Coverage for /pythoncovmergedfiles/medio/medio/src/jupyter_server/jupyter_server/_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

10 statements  

1""" 

2store the current version info of the server. 

3 

4""" 

5 

6import re 

7 

8# Version string must appear intact for automatic versioning 

9__version__ = "2.17.0.dev0" 

10 

11# Build up version_info tuple for backwards compatibility 

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

13match = re.match(pattern, __version__) 

14assert match is not None 

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

16if match["rest"]: 

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

18version_info = tuple(parts)