novela/containers/novela/version.py
Ivo Oskamp a8aa3e4fbf Release v0.2.12
Summarise the Sepia reading theme, sidebar build-version indicator, and
editor Find & Replace scope option into changelog.py and changelog.md. Reset
the dev BUILD segment to 0 and mark the develop log as released.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 14:03:33 +02:00

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 = 0
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