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