From dbaf5bfe2d63018510ed52860586d5fa5d89c61d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 19 Oct 2018 15:02:48 -0400 Subject: now correctly gets version from git --- doc/conf.py | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 1b6476d..271a897 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,40 +19,17 @@ # -- Project information ----------------------------------------------------- -from subprocess import Popen, PIPE - -def get_version(): - """ - Returns project version as string from 'git describe' command. - """ - pipe = Popen('git describe --tags', stdout=PIPE, shell=True) - version = pipe.stdout.read() - - if version: - return version - else: - return '0.0' - -def get_release(): - """ - Returns project version as string from 'git describe' command. - """ - pipe = Popen('git describe --tags --always', stdout=PIPE, shell=True) - version = pipe.stdout.read() - - if version: - return version - else: - return '0.0' +import re +import os project = 'Wolff' copyright = '2018, Jaron Kent-Dobias' author = 'Jaron Kent-Dobias' # The short X.Y version -version = '0.0' +version = re.sub('^v', '', os.popen('git describe --always').read().strip()) # The full version, including alpha/beta/rc tags -release = get_version().lstrip('v').rstrip() +release = version # -- General configuration --------------------------------------------------- -- cgit v1.2.3-54-g00ecf