Skip to content

Commit

Permalink
automating version numner
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultLSDC committed Dec 5, 2024
1 parent 3cec216 commit ef94260
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,7 +70,6 @@
}
html_static_path = ["_static"]

import os
import sys

sys.path.insert(0, os.path.abspath("../../src"))

0 comments on commit ef94260

Please sign in to comment.