lib.version: Add API docstrings
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 2m22s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m16s
CI / Packaging test (pull_request) Failing after 0s

The lib.version module carries no documentation: the Syntax, Component and
Boundary types, the Version and Dependency classes and their public methods
are bare, and the compatibility tiers the next_* stepping methods implement
are not documented anywhere.

Add docstrings: a line each for the base.py types, the compatibility
tier table in the Version class, and a short description for every
public method, with the three next_* methods citing the tier each one
steps to.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-09 13:52:30 +02:00
commit 01a0c40647
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
3 changed files with 64 additions and 0 deletions

View file

@ -8,11 +8,15 @@ if TYPE_CHECKING:
from .Version import Version
class Syntax(Enum): # export
"""Syntaxes for rendered version constraints"""
DEBIAN = auto()
SEM_VER = auto()
NAMES_ONLY = auto()
class Component(Flag): # export
"""Version components that parts_str() can extract"""
ID = auto()
MAJOR = auto()
MINOR = auto()
@ -21,6 +25,8 @@ class Component(Flag): # export
CORE = MAJOR | MINOR | MICRO
class Boundary(NamedTuple): # export
"""A comparison operator and the Version it bounds"""
op: str
version: Version