From 2cd729aa2f990154467f097565851a038f1c5da5 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 15 Sep 2012 18:50:43 +0200 Subject: [PATCH] docs: Include git revision in version number if we're in a git repo --- docs/conf.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index cd59d14d..8129adec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,11 +53,6 @@ MOCK_MODULES = [ for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock() -def get_version(): - init_py = open('../mopidy/__init__.py').read() - metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py)) - return metadata['version'] - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -96,6 +91,7 @@ copyright = u'2010-2012, Stein Magnus Jodal and contributors' # built documents. # # The full version, including alpha/beta/rc tags. +from mopidy import get_version release = get_version() # The short X.Y version. version = '.'.join(release.split('.')[:2])