Skip to content

Commit c1269c0

Browse files
Merge pull request #503 from matthew-brett/master
DOC: better warning when nibabel not on path Better warning from doc build when nibabel not installed. Inspired by #488 with thanks. Also closes #488
2 parents 6104bd1 + eef0359 commit c1269c0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

doc/source/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import sys
2323
import os
2424

25-
import nibabel
26-
2725
# Check for external Sphinx extensions we depend on
2826
try:
2927
import numpydoc
@@ -34,6 +32,13 @@
3432
except ImportError:
3533
raise RuntimeError('Need to install "texext" package for doc build')
3634

35+
# Need nibabel installed as well
36+
try:
37+
import nibabel
38+
except ImportError:
39+
raise RuntimeError('Need nibabel on Python PATH; consider "make htmldoc" '
40+
'from nibabel root directory')
41+
3742
# If extensions (or modules to document with autodoc) are in another directory,
3843
# add these directories to sys.path here. If the directory is relative to the
3944
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -82,7 +87,7 @@
8287

8388
# General information about the project.
8489
project = u'NiBabel'
85-
copyright = u'2006-2016, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel
90+
copyright = u'2006-2017, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel
8691

8792
# The version info for the project you're documenting, acts as replacement for
8893
# |version| and |release|, also used in various other places throughout the

0 commit comments

Comments
 (0)