From eef0359bf5f14bb7777bc3d916b1335d89bae242 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Thu, 12 Jan 2017 11:41:50 -0800 Subject: [PATCH] DOC: better warning when nibabel not on path Inspired by https://github.com/nipy/nibabel/pull/488 with thanks. --- doc/source/conf.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c33617f664..8856c50a8a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,8 +22,6 @@ import sys import os -import nibabel - # Check for external Sphinx extensions we depend on try: import numpydoc @@ -34,6 +32,13 @@ except ImportError: raise RuntimeError('Need to install "texext" package for doc build') +# Need nibabel installed as well +try: + import nibabel +except ImportError: + raise RuntimeError('Need nibabel on Python PATH; consider "make htmldoc" ' + 'from nibabel root 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 # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -82,7 +87,7 @@ # General information about the project. project = u'NiBabel' -copyright = u'2006-2016, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel +copyright = u'2006-2017, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the