From 619b41dc5b392e33de03ead0e91df698e12757bd Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 21 Apr 2026 14:07:26 +0100 Subject: [PATCH] fix: better version fetch --- VERSION | 1 - application/version.py | 32 ++++---------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index 2a0970ca..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.16.1 diff --git a/application/version.py b/application/version.py index 5d8ff590..4fd20a68 100644 --- a/application/version.py +++ b/application/version.py @@ -1,34 +1,10 @@ -"""DocsGPT backend version string. - -Read from the top-level ``VERSION`` file so release tooling can bump the -version without touching Python code. Cached after first read. -""" +"""DocsGPT backend version string.""" from __future__ import annotations -from pathlib import Path -from typing import Optional - -_UNKNOWN = "unknown" -_VERSION_PATH = Path(__file__).resolve().parent.parent / "VERSION" -_cached: Optional[str] = None +__version__ = "0.16.1" def get_version() -> str: - """Return the DocsGPT backend version, or ``"unknown"`` if absent. - - A missing ``VERSION`` file is treated as a soft failure — callers - (notably the startup version check) must never crash because the - file wasn't shipped with the source checkout. - """ - global _cached - if _cached is not None: - return _cached - try: - _cached = _VERSION_PATH.read_text(encoding="utf-8").strip() or _UNKNOWN - except (FileNotFoundError, OSError): - _cached = _UNKNOWN - return _cached - - -__version__ = get_version() + """Return the DocsGPT backend version.""" + return __version__