diff --git a/docs/source/conf.py b/docs/source/conf.py index 830f1ad..701ef80 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,9 +21,10 @@ import sys, os, glob # Support sphinx.ext.autodoc to extract docstrings from modules without installing # complete package. # 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: - 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: # lib dir has platform suffix sys.path.insert(0, os.path.abspath(built_lib[0])) @@ -51,16 +52,22 @@ master_doc = 'index' # General information about the project. 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 # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '0.9' -# The full version, including alpha/beta/rc tags. -release = '0.9.0' +try: + import llvm + version_strs = llvm.__version__.split('.') + # The short X.Y version. + version = '.'.join(version_strs[:2]) + # The full version, including alpha/beta/rc tags. + 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 # for a list of supported languages.