# Copyright (C) 2026 Hector van der Aa # Copyright (C) 2026 Association Exergie # SPDX-License-Identifier: GPL-3.0-or-later from typing import Literal from uuid import UUID from pydantic import BaseModel, ConfigDict, Field class VersionDescriptor(BaseModel): model_config = ConfigDict(frozen=True, populate_by_name=True, extra="forbid") type: Literal["alpha", "beta", "release"] = Field(alias="type") major: int = Field(ge=0) minor: int = Field(ge=0) patch: int = Field(ge=0) def get_version(self) -> str: return f"{self.major}.{self.minor}.{self.patch}-{self.type}"