File tree 3 files changed +28
-20
lines changed
3 files changed +28
-20
lines changed Original file line number Diff line number Diff line change 1
1
# This stub file is necessary because `_scm_version.py`
2
2
# autogenerated on build and absent on mypy checks time
3
+ from typing import Tuple , Union
4
+
3
5
version : str
6
+ version_tuple : Tuple [Union [int , str ], ...]
Original file line number Diff line number Diff line change 10
10
11
11
Version definition.
12
12
"""
13
+ from typing import Tuple , Union
14
+
13
15
try :
14
16
# pylint: disable=unused-import
15
- from ._scm_version import version as __version__ # noqa: WPS433, WPS436
17
+ from ._scm_version import version as __version__ , version_tuple as _ver_tup # noqa: WPS433, WPS436
16
18
except ImportError :
17
19
from pkg_resources import get_distribution as _get_dist # noqa: WPS433
18
20
__version__ = _get_dist ('proxy.py' ).version # noqa: WPS440
19
21
20
22
21
- __all__ = ('__version__' ,)
23
+ def _to_int_or_str (inp : str ) -> Union [int , str ]:
24
+ try :
25
+ return int (inp )
26
+ except ValueError :
27
+ return inp
28
+
29
+
30
+ def _split_version_parts (inp : str ) -> Tuple [str , ...]:
31
+ public_version , _plus , local_version = inp .partition ('+' )
32
+ return (* public_version .split ('.' ), local_version )
33
+
34
+
35
+ try :
36
+ VERSION = _ver_tup
37
+ except NameError :
38
+ VERSION = tuple (
39
+ map (_to_int_or_str , _split_version_parts (__version__ )),
40
+ )
41
+
42
+
43
+ __all__ = '__version__' , 'VERSION'
Original file line number Diff line number Diff line change 8
8
:copyright: (c) 2013-present by Abhinav Singh and contributors.
9
9
:license: BSD, see LICENSE for more details.
10
10
"""
11
- from typing import Tuple , Union
12
-
13
- from ._version import __version__ # noqa: WPS436
14
-
15
-
16
- def _to_int_or_str (inp : str ) -> Union [int , str ]:
17
- try :
18
- return int (inp )
19
- except ValueError :
20
- return inp
21
-
22
-
23
- def _split_version_parts (inp : str ) -> Tuple [str , ...]:
24
- public_version , _plus , local_version = inp .partition ('+' )
25
- return (* public_version .split ('.' ), local_version )
26
-
27
-
28
- VERSION = tuple (map (_to_int_or_str , _split_version_parts (__version__ )))
11
+ from ._version import __version__ , VERSION # noqa: WPS436
29
12
30
13
31
14
__all__ = '__version__' , 'VERSION'
You can’t perform that action at this time.
0 commit comments