pymead.utils.version_check.compare_versions#
- compare_versions(version_1: VersionInfo, version_2: VersionInfo)[source]#
Compares two versions. If the two versions are equal, return 2. If version 2 is newer than version 1, return 1. If version 2 is older than version 1, return 0.
- Parameters:
version_1 (VersionInfo or str) – First version to compare
version_2 (VersionInfo or str) – Second version to compare
- Returns:
Flag representing the result of the version comparison. 0: version 2 is older than version 1. 1: version 2 is newer than version 1. 2: the versions match.
- Return type: