Skip to content

Commit 72df175

Browse files
committed
RF: let setup.py sdist etc to run without nibabel
Data package message needed nibabel. Make this optional.
1 parent 9fbe26c commit 72df175

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ def configuration(parent_package='',top_path=None):
8484

8585
def data_install_msgs():
8686
# Check whether we have data packages
87-
from nibabel.data import datasource_or_bomber
87+
try: # Allow setup.py to run without nibabel
88+
from nibabel.data import datasource_or_bomber
89+
except ImportError:
90+
log.warn('Cannot check for optional data packages: see: '
91+
'http://nipy.org/nipy/stable/users/install_data.html')
92+
return
8893
DATA_PKGS = INFO_VARS['DATA_PKGS']
8994
templates = datasource_or_bomber(DATA_PKGS['nipy-templates'])
9095
example_data = datasource_or_bomber(DATA_PKGS['nipy-data'])

0 commit comments

Comments
 (0)