File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,9 @@ def min_version(the_module, min_version_str: str = "") -> bool:
96
96
Returns True if the module's version is greater or equal to the 'min_version'.
97
97
When min_version_str is not provided, it always returns True.
98
98
"""
99
- if not min_version_str :
99
+ if not min_version_str or not hasattr ( the_module , "__version__" ) :
100
100
return True # always valid version
101
- if not hasattr (the_module , "__version__" ):
102
- warnings .warn (f"{ the_module } has no attribute __version__ in min_version check." )
103
- return True # min_version is the default, shouldn't be noisy
101
+
104
102
mod_version = tuple (int (x ) for x in the_module .__version__ .split ("." )[:2 ])
105
103
required = tuple (int (x ) for x in min_version_str .split ("." )[:2 ])
106
104
return mod_version >= required
You can’t perform that action at this time.
0 commit comments