Debian Codegraph @

jupyter_console/_version.py

raw
1 import re
2 from typing import List, Union
3
4 __version__ = "6.6.3"
5
6 # Build up version_info tuple for backwards compatibility
7 pattern = r'(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)'
8 match = re.match(pattern, __version__)
9 if match:
10 parts: List[Union[int, str]] = [int(match[part]) for part in ['major', 'minor', 'patch']]
11 if match['rest']:
12 parts.append(match['rest'])
13 else:
14 parts = []
15 version_info = tuple(parts)