taagarwa's picture
✨ Add project versioning
fa603f3
Raw
History Blame Contribute Delete
577 Bytes
"""Project version, sourced from the top-level ``VERSION`` file.
``VERSION`` is the single source of truth. Bump it in a PR (``make bump
VERSION=X.Y.Z``); when the bump lands on ``main``, CI tags the merge commit
``vX.Y.Z`` and deploys it to the production HF Space (see README "Releasing").
"""
from pathlib import Path
VERSION_FILE = Path(__file__).resolve().parent.parent / "VERSION"
def read_version() -> str:
try:
return VERSION_FILE.read_text(encoding="utf-8").strip() or "0.0.0"
except OSError:
return "0.0.0"
__version__ = read_version()