Skip to content

Commit 9e512bc

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pytest
2 parents 8db1cd9 + f043012 commit 9e512bc

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.travis.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,28 @@ jobs:
6161
- python: 3.7
6262
env:
6363
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
64+
# OSX Python support is basically accidental. Take whatever version we can
65+
# get and test with full dependencies...
66+
- os: osx
67+
language: minimal
68+
# and pre-releases. No min-requirements.txt because we can't assume a wheel that old.
69+
- os: osx
70+
language: minimal
71+
env:
72+
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
73+
# Test that PyPI installs from source pass
6474
- python: 3.5
6575
env:
6676
- INSTALL_TYPE=sdist
77+
# Wheels (binary distributions)
6778
- python: 3.5
6879
env:
6980
- INSTALL_TYPE=wheel
81+
# Install from git archive (e.g., https://github.com/nipy/nibabel/archive/master.zip)
7082
- python: 3.5
7183
env:
7284
- INSTALL_TYPE=archive
85+
# Run flake8... Might not be needed now we have pep8speaks
7386
- python: 3.5
7487
env:
7588
- CHECK_TYPE="style"
@@ -80,42 +93,42 @@ jobs:
8093

8194
# Set up virtual environment, build package, build from depends
8295
before_install:
83-
- travis_retry python -m pip install --upgrade pip virtualenv
84-
- virtualenv --python=python venv
96+
- travis_retry python3 -m pip install --upgrade pip virtualenv
97+
- virtualenv --python=python3 venv
8598
- source venv/bin/activate
86-
- python --version # just to check
87-
- travis_retry pip install -U $SETUP_REQUIRES
99+
- python3 --version # just to check
100+
- travis_retry python3 -m pip install -U $SETUP_REQUIRES
88101
- |
89102
if [ "$INSTALL_TYPE" == "sdist" ]; then
90-
python setup.py egg_info # check egg_info while we're here
91-
python setup.py sdist
103+
python3 setup.py egg_info # check egg_info while we're here
104+
python3 setup.py sdist
92105
export ARCHIVE=$( ls dist/*.tar.gz )
93106
elif [ "$INSTALL_TYPE" == "wheel" ]; then
94-
python setup.py bdist_wheel
107+
python3 setup.py bdist_wheel
95108
export ARCHIVE=$( ls dist/*.whl )
96109
elif [ "$INSTALL_TYPE" == "archive" ]; then
97110
export ARCHIVE="package.tar.gz"
98111
git archive -o $ARCHIVE HEAD
99112
fi
100-
- if [ -n "$DEPENDS" ]; then pip install $EXTRA_PIP_FLAGS $DEPENDS; fi
113+
- if [ -n "$DEPENDS" ]; then python3 -m pip install $EXTRA_PIP_FLAGS $DEPENDS; fi
101114

102115
# command to install dependencies
103116
install:
104117
- |
105118
if [ "$INSTALL_TYPE" == "setup" ]; then
106-
python setup.py install
119+
python3 setup.py install
107120
else
108-
pip install $EXTRA_PIP_FLAGS $ARCHIVE
121+
python3 -m pip install $EXTRA_PIP_FLAGS $ARCHIVE
109122
fi
110123
# Basic import check
111-
- python -c 'import nibabel; print(nibabel.__version__)'
124+
- python3 -c 'import nibabel; print(nibabel.__version__)'
112125
- if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
113126

114127
before_script:
115128
# Point to nibabel data directory
116129
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
117130
# Because nibabel is already installed, will just look up the extra
118-
- pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
131+
- python3 -m pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
119132

120133
# command to run tests, e.g. python setup.py test
121134
script:
@@ -155,7 +168,7 @@ script:
155168
fi
156169
157170
after_script:
158-
- travis_retry pip install codecov
171+
- travis_retry python3 -m pip install codecov
159172
- codecov
160173

161174
notifications:

nibabel/minc2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
"""
2828
import numpy as np
2929

30-
from ._h5py_compat import h5py
31-
3230
from .minc1 import Minc1File, MincHeader, Minc1Image, MincError
3331

3432

@@ -158,6 +156,9 @@ class Minc2Image(Minc1Image):
158156

159157
@classmethod
160158
def from_file_map(klass, file_map, *, mmap=True, keep_file_open=None):
159+
# Import of h5py might take awhile for MPI-enabled builds
160+
# So we are importing it here "on demand"
161+
from ._h5py_compat import h5py
161162
holder = file_map['image']
162163
if holder.filename is None:
163164
raise MincError('MINC2 needs filename for load')

0 commit comments

Comments
 (0)