Skip to content
Snippets Groups Projects
Commit e67655c3 authored by Todd Gamblin's avatar Todd Gamblin
Browse files

docs autodetect version.

parent c7b8a4e2
Branches
Tags
No related merge requests found
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # 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, # 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 # add these directories to sys.path here. If the directory is relative to the
...@@ -43,9 +45,13 @@ ...@@ -43,9 +45,13 @@
sys.path.insert(0, os.path.abspath('exts')) 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. # 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' 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 # Set an environment variable so that colify will print output like it would to
# a terminal. # a terminal.
os.environ['COLIFY_TTY'] = 'true' os.environ['COLIFY_TTY'] = 'true'
...@@ -97,9 +103,9 @@ ...@@ -97,9 +103,9 @@
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '1.0' version = '.'.join(spack_version[:2])
# The full version, including alpha/beta/rc tags. # 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 # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
# Version information # Version information
from spack.version import Version from spack.version import Version
spack_version = Version("0.8") spack_version = Version("0.8.15")
# #
# Executables used by Spack # Executables used by Spack
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
import re import re
import cgi
from StringIO import StringIO from StringIO import StringIO
import llnl.util.tty as tty import llnl.util.tty as tty
from llnl.util.tty.colify import * from llnl.util.tty.colify import *
...@@ -70,9 +71,9 @@ def print_rst_package_list(): ...@@ -70,9 +71,9 @@ def print_rst_package_list():
print print
print pkg.name print pkg.name
print "-" * len(pkg.name) print "-" * len(pkg.name)
print "Links" print "Links:"
print " * `Homepage <%s>`__" % pkg.homepage print " * `%s <%s>`__" % (cgi.escape(pkg.homepage), pkg.homepage)
print " * `%s/package.py <%s>`__" % (pkg.name, github_url(pkg)) print " * `%s/package.py <%s>`__" % (pkg.name, github_url(pkg))
print print
if pkg.versions: if pkg.versions:
print "Versions:" print "Versions:"
...@@ -82,7 +83,7 @@ def print_rst_package_list(): ...@@ -82,7 +83,7 @@ def print_rst_package_list():
print " " + ", ".join("`%s`_" % d if d != "mpi" else d print " " + ", ".join("`%s`_" % d if d != "mpi" else d
for d in pkg.dependencies) for d in pkg.dependencies)
print print
print "Description" print "Description:"
print pkg.format_doc(indent=2) print pkg.format_doc(indent=2)
print print
print "-----" print "-----"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment