docs: Extract current version from git and use it in the install instructions.

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-12-17 09:46:26 +01:00
parent 7f6e244f61
commit c2c97997cd
2 changed files with 24 additions and 9 deletions
+14
View File
@@ -13,6 +13,8 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import re
# -- Project information -----------------------------------------------------
@@ -20,6 +22,18 @@ project = 'Kapow!'
copyright = '2019, BBVA Innovation Labs'
author = 'BBVA Innovation Labs'
# The full version, including alpha/beta/rc tags.
try:
release = re.sub('^v', '', os.popen('git describe').read().strip())
except:
release = 'unknown'
try:
# The short X.Y.Z-rcN version.
version = re.search('^(\d+\.\d+\.\d+(:?-rc\d+)?)', release).group(0)
except:
version = release
# -- General configuration ---------------------------------------------------