This repository was archived by the owner on Feb 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030DependencyVersion = namedtuple ("DependencyVersion" , ["version" , "version_string" ])
3131
32+ UNKNOWN_VERSION_STRING = "--"
33+
3234
3335def get_dependency_version (
3436 dependency_name : str ,
@@ -43,9 +45,11 @@ def get_dependency_version(
4345 dependency_name: The distribution name of the package (e.g., 'requests').
4446
4547 Returns:
46- A DependencyVersion namedtuple with `version` and `version_string`
47- attributes, or `DependencyVersion(None, '--')` if the package is not
48- found or another error occurs during version discovery.
48+ A DependencyVersion namedtuple with `version` and
49+ `version_string` attributes, or `DependencyVersion(None,
50+ UNKNOWN_VERSION_STRING)` if the package is not found or
51+ another error occurs during version discovery.
52+
4953 """
5054 try :
5155 if sys .version_info >= (3 , 8 ):
@@ -64,7 +68,7 @@ def get_dependency_version(
6468 return DependencyVersion (parse_version (version_string ), version_string )
6569
6670 except Exception :
67- return DependencyVersion (None , "--" )
71+ return DependencyVersion (None , UNKNOWN_VERSION_STRING )
6872
6973
7074def warn_deprecation_for_versions_less_than (
You can’t perform that action at this time.
0 commit comments