#!/usr/bin/env python3 """Increment Novela's explicit dev/test build number.""" from __future__ import annotations import re from pathlib import Path ROOT = Path(__file__).resolve().parents[1] VERSION_FILE = ROOT / "containers" / "novela" / "version.py" text = VERSION_FILE.read_text() match = re.search(r"^BUILD = (\d+)\s*$", text, flags=re.MULTILINE) if not match: raise SystemExit(f"BUILD assignment not found in {VERSION_FILE}") next_build = int(match.group(1)) + 1 text = text[: match.start(1)] + str(next_build) + text[match.end(1) :] VERSION_FILE.write_text(text) print(f"[bump-dev-build] BUILD = {next_build}")