The version_checker.py module#

Summary#

VersionChecker

Class to check version.

check_version

Check that the input version is greater than or equal to the major.minor.patch.

Description#

Module to ease version checks.

Module detail#

version_checker.check_version(input_version, major, minor, patch=None)#

Check that the input version is greater than or equal to the major.minor.patch.

Parameters:
input_version: str

Input version written as “major.minor.patch”, e.g. “2026.1.0”

majorint

Major release version, e.g. 2025

minorint

Minor release version e.g. 2

patchOptional[int]

Service Pack version e.g. 3. If not provided, the patch is not considered in the comparison.

Returns:
bool

True if the input version is >= to the major.minor.patch

Notes

The patch part of input_version can carry a suffix, e.g. "3-suffix". In that case only the leading number (3) is used for the comparison. The patch part can also be a development marker, e.g. "dev0", "dev1". A development patch is always considered lower than any numbered patch, including 0. A version that cannot be parsed, e.g. "" or "2026", is considered lower than any requested version, so False is returned.

version_checker.server_version_checker#