Add validate_version function to version_helper.py

This commit is contained in:
Mikhail f. Shiryaev 2022-03-31 00:11:25 +02:00
parent 5212ff0146
commit 93cfc4d590
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -138,6 +138,14 @@ class VersionType:
VALID = (TESTING, PRESTABLE, STABLE, LTS)
def validate_version(version: str):
parts = version.split(".")
if len(parts) != 4:
raise ValueError(f"{version} does not contain 4 parts")
for part in parts:
int(part)
def get_abs_path(path: str) -> str:
return p.abspath(p.join(git.root, path))