Modified documentation configuration to search for build specific to Python version. Updated copyright. First attempt at using llvm._version to set documentation version.

This commit is contained in:
Jon Riehl 2013-02-26 15:48:00 -06:00
commit 894539681b

View file

@ -21,9 +21,10 @@ import sys, os, glob
# Support sphinx.ext.autodoc to extract docstrings from modules without installing # Support sphinx.ext.autodoc to extract docstrings from modules without installing
# complete package. # complete package.
# The python modules depend on _core, so we must build entire package first though. # The python modules depend on _core, so we must build entire package first though.
built_lib = glob.glob('../../build/lib.*/') built_lib = glob.glob('../../build/lib.*-%d.%d/' % sys.version_info[:2])
if not built_lib: if not built_lib:
print "WARNING: To build complete documentation you must build package first" sys.stderr.write("WARNING: To build complete documentation you must build "
"package first\n")
else: else:
# lib dir has platform suffix # lib dir has platform suffix
sys.path.insert(0, os.path.abspath(built_lib[0])) sys.path.insert(0, os.path.abspath(built_lib[0]))
@ -51,16 +52,22 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'llvmpy' project = u'llvmpy'
copyright = u'2012, Mahadevan R (2008-2010), Continuum Analytics (2012)' copyright = u'2013, Mahadevan R (2008-2010), Continuum Analytics (2012-2013)'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
try:
import llvm
version_strs = llvm.__version__.split('.')
# The short X.Y version. # The short X.Y version.
version = '0.9' version = '.'.join(version_strs[:2])
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.9.0' release = '%s.%s' % (version, '-'.join(version_strs[2].split('-')[:2]))
except ImportError:
version = 'unknown-version'
release = 'unknown-release'
# 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.