check version string found_version >= expected_min_or_eq_to_version If dev/prerelease tags result in TypeError for string-number comparison, it is assumed that the dependency is satisfied. Users on dev branches are responsible for keeping their own packages up to date.
(found_version, expected_min_or_eq_to_version)
| 26 | |
| 27 | |
| 28 | def check_version(found_version, expected_min_or_eq_to_version): |
| 29 | """check version string found_version >= expected_min_or_eq_to_version |
| 30 | |
| 31 | If dev/prerelease tags result in TypeError for string-number comparison, |
| 32 | it is assumed that the dependency is satisfied. |
| 33 | Users on dev branches are responsible for keeping their own packages up to date. |
| 34 | """ |
| 35 | try: |
| 36 | return _Version(found_version) >= _Version(expected_min_or_eq_to_version) |
| 37 | except TypeError: |
| 38 | return True |
| 39 | |
| 40 | |
| 41 | if __name__ == "__main__": |
no test coverage detected