mirror of
https://github.com/kakwa/uts-server
synced 2024-12-04 23:15:54 +01:00
recover version directory from CMakeLists.txt
this avoid mistakes caused by double declaration of the version in CMakeLists.txt and conf.py
This commit is contained in:
parent
a6d73bfd49
commit
f51c942f8e
11
docs/conf.py
11
docs/conf.py
@ -16,9 +16,18 @@
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
|
||||
def get_version():
|
||||
cmake = os.path.join(os.path.dirname(__file__),'../CMakeLists.txt')
|
||||
with open(cmake) as f:
|
||||
for line in f.readlines():
|
||||
m = re.search('set\(VERSION ([\.0-9]+)\)', line)
|
||||
if m:
|
||||
return m.group(1)
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
@ -50,7 +59,7 @@ copyright = u'2016, Pierre-Francois Carpentier'
|
||||
#
|
||||
# The short X.Y version.
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.0.2'
|
||||
release = get_version()
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
Loading…
Reference in New Issue
Block a user