lib.version: Add API docstrings
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:
parent
4e5a4754af
commit
01a0c40647
3 changed files with 64 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue