From ef94260f07330bd73d8c3d4ded3cb8e6ecaf47ef Mon Sep 17 00:00:00 2001 From: ThibaultLSDC Date: Thu, 5 Dec 2024 11:27:46 -0500 Subject: [PATCH] automating version numner --- docs/source/conf.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 23003e96..57e2f2fa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,10 +6,23 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import os +import subprocess + + +# Automatically retrieve the project version from Git +def get_version(): + try: + return subprocess.check_output(["git", "describe", "--tags"], encoding="utf-8").strip() + except Exception: + return "0.0.0" + + project = "AgentLab" -copyright = "2024, ServiceNow" author = "ServiceNow" -release = "0.3.1" +release = get_version() # Full version string including tags +version = release # Short version (e.g., 1.0) + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -57,7 +70,6 @@ } html_static_path = ["_static"] -import os import sys sys.path.insert(0, os.path.abspath("../../src"))