Checks that module has a higher version that minver. params: - module: a module to test - minver: a tuple of versions
(module, minver)
| 719 | |
| 720 | |
| 721 | def _version_checker(module, minver): |
| 722 | # type: (ModuleType, Tuple[int, ...]) -> bool |
| 723 | """Checks that module has a higher version that minver. |
| 724 | |
| 725 | params: |
| 726 | - module: a module to test |
| 727 | - minver: a tuple of versions |
| 728 | """ |
| 729 | # We could use LooseVersion, but distutils imports imp which is deprecated |
| 730 | version_regexp = r'[a-z]?((?:\d|\.)+\d+)(?:\.dev[0-9]+)?' |
| 731 | version_tags_r = re.match( |
| 732 | version_regexp, |
| 733 | getattr(module, "__version__", "") |
| 734 | ) |
| 735 | if not version_tags_r: |
| 736 | return False |
| 737 | version_tags_i = version_tags_r.group(1).split(".") |
| 738 | version_tags = tuple(int(x) for x in version_tags_i) |
| 739 | return bool(version_tags >= minver) |
| 740 | |
| 741 | |
| 742 | def isCryptographyValid(): |
no outgoing calls
no test coverage detected
searching dependent graphs…