docs: Autodetect version and copyright year in the sphinx doc

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Suggested-by: Rusty Russell <@rustyrussell>
This commit is contained in:
Christian Decker 2019-02-19 19:48:55 +01:00
parent 8fb2e6be7f
commit 816f20d1c0
1 changed files with 6 additions and 3 deletions

View File

@ -21,6 +21,9 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from datetime import datetime
import subprocess
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@ -59,17 +62,17 @@ master_doc = 'index'
# General information about the project.
project = 'c-lightning'
copyright = '2019, c-lightning dev community'
author = 'c-lightning Developers'
copyright = datetime.now().strftime('2015 — %Y, {}'.format(author))
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.6.3'
version = subprocess.check_output('git describe --always --dirty=-modded --abbrev=7'.split()).decode('ASCII')
# The full version, including alpha/beta/rc tags.
release = '0.6.3pre'
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.