From 816f20d1c0cd6bd8f06cec51f9c04fd7a3cbb359 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 19 Feb 2019 19:48:55 +0100 Subject: [PATCH] docs: Autodetect version and copyright year in the sphinx doc Signed-off-by: Christian Decker Suggested-by: Rusty Russell <@rustyrussell> --- doc/conf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9037a1851..2352d1f46 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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.