diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-19 15:02:48 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-19 15:02:48 -0400 |
commit | dbaf5bfe2d63018510ed52860586d5fa5d89c61d (patch) | |
tree | 50d44e66498bb3948972044edea1b9a0771e94dc /doc | |
parent | aed8d4f0448bae1e68cf4ff2af0fce87768b921c (diff) | |
download | c++-dbaf5bfe2d63018510ed52860586d5fa5d89c61d.tar.gz c++-dbaf5bfe2d63018510ed52860586d5fa5d89c61d.tar.bz2 c++-dbaf5bfe2d63018510ed52860586d5fa5d89c61d.zip |
now correctly gets version from git
Diffstat (limited to 'doc')
-rw-r--r-- | doc/conf.py | 31 |
1 files 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 --------------------------------------------------- |