Skip to content

Commit 27a1fd3

Browse files
committed
Add code to get info of release and version from git tags
1 parent 0e79a27 commit 27a1fd3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

doc/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
project = 'Slycot'
1414
copyright = '2023, Slycot Developers'
1515
author = 'Slycot Developers'
16-
release = '0.6'
16+
17+
# Version information - read from the source code
18+
import re
19+
20+
# Get the version number for this commmit (including alpha/beta/rc tags)
21+
release = re.sub('^v', '', os.popen('git describe').read().strip())
22+
23+
# The short X.Y.Z version
24+
version = re.sub(r'(\d+\.\d+\.\d+(.post\d+)?)(.*)', r'\1', release)
25+
26+
print("version %s, release %s" % (version, release))
1727

1828
# -- General configuration ---------------------------------------------------
1929
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

0 commit comments

Comments
 (0)