version: add kbs version check functionality and CLI

This commit is contained in:
InsanePrawn 2025-03-03 03:31:46 +01:00
parent c844978b4d
commit 821bde59e9
7 changed files with 190 additions and 0 deletions

12
version/compare.py Normal file
View file

@ -0,0 +1,12 @@
from enum import IntEnum
from semver import Version
class VerComp(IntEnum):
RIGHT_NEWER = -1
EQUAL = 0
RIGHT_OLDER = 1
def semver_compare(a: str, b: str) -> VerComp:
return VerComp(Version.parse(a).compare(b))