summaryrefslogtreecommitdiff
path: root/lib/spack/docs/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/docs/conf.py')
-rw-r--r--lib/spack/docs/conf.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py
index b4d49c594d..86df113074 100644
--- a/lib/spack/docs/conf.py
+++ b/lib/spack/docs/conf.py
@@ -35,7 +35,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys
+import os
+import subprocess
# 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
@@ -43,14 +45,16 @@ import sys, os
sys.path.insert(0, os.path.abspath('exts'))
# Add the Spack bin directory to the path so that we can use its output in docs.
-os.environ['SPACK_ROOT'] = '../../..'
+spack_root = '../../..'
+os.environ['SPACK_ROOT'] = spack_root
os.environ['PATH'] += os.pathsep + '$SPACK_ROOT/bin'
+spack_version = subprocess.Popen(
+ ['spack', '-V'], stderr=subprocess.PIPE).communicate()[1].strip().split('.')
+
# Set an environment variable so that colify will print output like it would to
# a terminal.
-os.environ['COLIFY_TTY'] = 'true'
-os.environ['COLUMNS'] = '80'
-os.environ['LINES'] = '25'
+os.environ['COLIFY_SIZE'] = '25x80'
# Enable todo items
todo_include_todos = True
@@ -97,9 +101,9 @@ copyright = u'2013-2014, Lawrence Livermore National Laboratory'
# built documents.
#
# The short X.Y version.
-version = '1.0'
+version = '.'.join(spack_version[:2])
# The full version, including alpha/beta/rc tags.
-release = '1.0'
+release = '.'.join(spack_version[:2])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.