File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
1
3
import sys
2
4
3
5
from packaging .version import Version
11
13
COMMIT_HASH = '$Format:%h$'
12
14
13
15
14
- def _cmp (a , b ):
16
+ def _cmp (a , b ) -> int :
15
17
"""Implementation of ``cmp`` for Python 3"""
16
18
return (a > b ) - (a < b )
17
19
18
20
19
- def cmp_pkg_version (version_str , pkg_version_str = __version__ ):
21
+ def cmp_pkg_version (version_str : str , pkg_version_str : str = __version__ ) -> int :
20
22
"""Compare ``version_str`` to current package version
21
23
22
24
This comparator follows `PEP-440`_ conventions for determining version
@@ -67,7 +69,7 @@ def cmp_pkg_version(version_str, pkg_version_str=__version__):
67
69
return _cmp (Version (version_str ), Version (pkg_version_str ))
68
70
69
71
70
- def pkg_commit_hash (pkg_path : str = None ):
72
+ def pkg_commit_hash (pkg_path : str = None ) -> tuple [ str , str ] :
71
73
"""Get short form of commit hash
72
74
73
75
In this file is a variable called COMMIT_HASH. This contains a substitution
@@ -112,7 +114,7 @@ def pkg_commit_hash(pkg_path: str = None):
112
114
return '(none found)' , '<not found>'
113
115
114
116
115
- def get_pkg_info (pkg_path ) :
117
+ def get_pkg_info (pkg_path : str ) -> dict :
116
118
"""Return dict describing the context of this package
117
119
118
120
Parameters
You can’t perform that action at this time.
0 commit comments