27 lines
827 B
Python
27 lines
827 B
Python
"""Novela version metadata.
|
|
|
|
The release version is the single source maintained in ``changelog.py``
|
|
(``CHANGELOG[0]["version"]``). Dev/test builds append an explicit ``BUILD``
|
|
segment that is incremented by ``scripts/bump-dev-build.py`` on every test
|
|
build, so operators can see exactly which image build is running in the
|
|
sidebar. ``BUILD`` is reset to 0 for releases.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from changelog import CHANGELOG
|
|
|
|
BUILD = 6
|
|
|
|
|
|
def _release_version() -> str:
|
|
"""Return the semantic release version (e.g. v0.2.11)."""
|
|
return CHANGELOG[0]["version"] if CHANGELOG else "v0.0.0"
|
|
|
|
|
|
def display_version() -> str:
|
|
"""Return the user-visible Novela version (e.g. v0.2.11 or v0.2.11.3)."""
|
|
version = _release_version()
|
|
if BUILD > 0:
|
|
return f"{version}.{BUILD}"
|
|
return version
|