Skip to content

Commit ef94260

Browse files
committed
automating version numner
1 parent 3cec216 commit ef94260

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docs/source/conf.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@
66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

9+
import os
10+
import subprocess
11+
12+
13+
# Automatically retrieve the project version from Git
14+
def get_version():
15+
try:
16+
return subprocess.check_output(["git", "describe", "--tags"], encoding="utf-8").strip()
17+
except Exception:
18+
return "0.0.0"
19+
20+
921
project = "AgentLab"
10-
copyright = "2024, ServiceNow"
1122
author = "ServiceNow"
12-
release = "0.3.1"
23+
release = get_version() # Full version string including tags
24+
version = release # Short version (e.g., 1.0)
25+
1326

1427
# -- General configuration ---------------------------------------------------
1528
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -57,7 +70,6 @@
5770
}
5871
html_static_path = ["_static"]
5972

60-
import os
6173
import sys
6274

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

0 commit comments

Comments
 (0)