Skip to content

Commit 704b97d

Browse files
authored
Merge pull request #2600 from effigies/ci/travis_python
CI: Stop using Miniconda on Travis
2 parents eae8b20 + 2025a06 commit 704b97d

File tree

6 files changed

+70
-108
lines changed

6 files changed

+70
-108
lines changed

.travis.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,24 @@ python:
1010
- 3.6
1111

1212
env:
13-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
14-
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
15-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit,ssh" CI_SKIP_TEST=1
16-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" PIP_FLAGS="--pre" CI_SKIP_TEST=1
13+
global:
14+
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
15+
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
16+
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
17+
matrix:
18+
- INSTALL_DEB_DEPENDECIES=true
19+
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
20+
CI_SKIP_TEST=1
21+
- INSTALL_DEB_DEPENDECIES=false
22+
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
23+
CI_SKIP_TEST=1
24+
- INSTALL_DEB_DEPENDECIES=true
25+
NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit,ssh"
26+
CI_SKIP_TEST=1
27+
- INSTALL_DEB_DEPENDECIES=true
28+
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
29+
EXTRA_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
30+
CI_SKIP_TEST=1
1731

1832
addons:
1933
apt:
@@ -39,23 +53,12 @@ before_install:
3953
export FSLOUTPUTTYPE=NIFTI_GZ;
4054
fi;
4155

42-
# handle python operations separately to reduce timeouts
43-
- wget https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
44-
-O /home/travis/.cache/conda.sh
45-
- bash ${HOME}/.cache/conda.sh -b -p ${HOME}/conda
46-
- export PATH=${HOME}/conda/bin:$PATH
47-
- hash -r
48-
- conda config --set always_yes yes --set changeps1 no
49-
- travis_retry conda update -q conda
50-
- conda config --add channels conda-forge
51-
- travis_retry conda install -y python=${TRAVIS_PYTHON_VERSION} icu
5256
- travis_retry pip install -r requirements.txt
5357
- travis_retry git clone https://github.com/INCF/pybids.git ${HOME}/pybids &&
5458
pip install -e ${HOME}/pybids
55-
- travis_retry pip install codecov
5659

5760
install:
58-
- travis_retry pip install $PIP_FLAGS -e .[$NIPYPE_EXTRAS]
61+
- travis_retry pip install $EXTRA_PIP_FLAGS -e .[$NIPYPE_EXTRAS]
5962

6063
script:
6164
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype

nipype/interfaces/base/core.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,8 @@ class SimpleInterface(BaseInterface):
692692
Examples
693693
--------
694694
695-
.. testsetup::
696-
697-
>>> from .specs import TraitedSpec
698-
>>> tmp = getfixture('tmpdir')
699-
>>> old = tmp.chdir() # changing to a temporary directory
700-
701-
.. doctest::
695+
>>> from nipype.interfaces.base import (
696+
... SimpleInterface, BaseInterfaceInputSpec, TraitedSpec)
702697
703698
>>> def double(x):
704699
... return 2 * x
@@ -721,11 +716,6 @@ class SimpleInterface(BaseInterface):
721716
>>> dbl.inputs.x = 2
722717
>>> dbl.run().outputs.doubled
723718
4.0
724-
725-
.. testsetup::
726-
727-
>>> os.chdir(old.strpath)
728-
729719
"""
730720

731721
def __init__(self, from_file=None, resource_monitor=None, **inputs):

nipype/interfaces/dcm2nii.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,14 @@ class Dcm2nii(CommandLine):
106106
Examples
107107
========
108108
109-
.. testsetup::
110-
111-
>>> tmp = getfixture('tmpdir')
112-
>>> old = tmp.chdir() # changing to a temporary directory
113-
114-
.. doctest::
115-
116109
>>> from nipype.interfaces.dcm2nii import Dcm2nii
117110
>>> converter = Dcm2nii()
118-
>>> converter.inputs.source_names = [os.path.join(datadir, 'functional_1.dcm'), os.path.join(datadir, 'functional_2.dcm')]
111+
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
119112
>>> converter.inputs.gzip_output = True
120113
>>> converter.inputs.output_dir = '.'
121-
>>> converter.cmdline #doctest: +ELLIPSIS
122-
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n ...functional_1.dcm'
123-
124-
.. testsetup::
125-
126-
>>> os.chdir(old.strpath)
127-
128-
"""
114+
>>> converter.cmdline # doctest: +ELLIPSIS
115+
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'
116+
"""
129117

130118
input_spec = Dcm2niiInputSpec
131119
output_spec = Dcm2niiOutputSpec

nipype/interfaces/image.py

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -110,58 +110,63 @@ class ReorientOutputSpec(TraitedSpec):
110110
class Reorient(SimpleInterface):
111111
"""Conform an image to a given orientation
112112
113-
Flips and reorder the image data array so that the axes match the
114-
directions indicated in ``orientation``.
115-
The default ``RAS`` orientation corresponds to the first axis being ordered
116-
from left to right, the second axis from posterior to anterior, and the
117-
third axis from inferior to superior.
113+
Flips and reorder the image data array so that the axes match the
114+
directions indicated in ``orientation``.
115+
The default ``RAS`` orientation corresponds to the first axis being ordered
116+
from left to right, the second axis from posterior to anterior, and the
117+
third axis from inferior to superior.
118118
119-
For oblique images, the original orientation is considered to be the
120-
closest plumb orientation.
119+
For oblique images, the original orientation is considered to be the
120+
closest plumb orientation.
121121
122-
No resampling is performed, and thus the output image is not de-obliqued
123-
or registered to any other image or template.
122+
No resampling is performed, and thus the output image is not de-obliqued
123+
or registered to any other image or template.
124124
125-
The effective transform is calculated from the original affine matrix to
126-
the reoriented affine matrix.
125+
The effective transform is calculated from the original affine matrix to
126+
the reoriented affine matrix.
127127
128-
Examples
129-
--------
128+
Examples
129+
--------
130130
131-
If an image is not reoriented, the original file is not modified
131+
If an image is not reoriented, the original file is not modified
132132
133-
>>> import numpy as np
134-
>>> from nipype.interfaces.image import Reorient
135-
>>> reorient = Reorient(orientation='LPS')
136-
>>> reorient.inputs.in_file = 'segmentation0.nii.gz'
137-
>>> res = reorient.run()
138-
>>> res.outputs.out_file
139-
'segmentation0.nii.gz'
133+
.. testsetup::
140134
141-
>>> print(np.loadtxt(res.outputs.transform))
142-
[[1. 0. 0. 0.]
143-
[0. 1. 0. 0.]
144-
[0. 0. 1. 0.]
145-
[0. 0. 0. 1.]]
135+
>>> def print_affine(matrix):
136+
... print(str(matrix).replace(']', ' ').replace('[', ' '))
146137
147-
>>> reorient.inputs.orientation = 'RAS'
148-
>>> res = reorient.run()
149-
>>> res.outputs.out_file # doctest: +ELLIPSIS
150-
'.../segmentation0_ras.nii.gz'
138+
>>> import numpy as np
139+
>>> from nipype.interfaces.image import Reorient
140+
>>> reorient = Reorient(orientation='LPS')
141+
>>> reorient.inputs.in_file = 'segmentation0.nii.gz'
142+
>>> res = reorient.run()
143+
>>> res.outputs.out_file
144+
'segmentation0.nii.gz'
151145
152-
>>> print(np.loadtxt(res.outputs.transform))
153-
[[-1. 0. 0. 60.]
154-
[ 0. -1. 0. 72.]
155-
[ 0. 0. 1. 0.]
156-
[ 0. 0. 0. 1.]]
146+
>>> print_affine(np.loadtxt(res.outputs.transform))
147+
1. 0. 0. 0.
148+
0. 1. 0. 0.
149+
0. 0. 1. 0.
150+
0. 0. 0. 1.
157151
158-
.. testcleanup::
152+
>>> reorient.inputs.orientation = 'RAS'
153+
>>> res = reorient.run()
154+
>>> res.outputs.out_file # doctest: +ELLIPSIS
155+
'.../segmentation0_ras.nii.gz'
159156
160-
>>> import os
161-
>>> os.unlink(res.outputs.out_file)
162-
>>> os.unlink(res.outputs.transform)
157+
>>> print_affine(np.loadtxt(res.outputs.transform))
158+
-1. 0. 0. 60.
159+
0. -1. 0. 72.
160+
0. 0. 1. 0.
161+
0. 0. 0. 1.
163162
164-
"""
163+
.. testcleanup::
164+
165+
>>> import os
166+
>>> os.unlink(res.outputs.out_file)
167+
>>> os.unlink(res.outputs.transform)
168+
169+
"""
165170
input_spec = ReorientInputSpec
166171
output_spec = ReorientOutputSpec
167172

nipype/interfaces/io.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,13 +2585,6 @@ class JSONFileGrabber(IOBase):
25852585
Example
25862586
-------
25872587
2588-
.. testsetup::
2589-
2590-
>>> tmp = getfixture('tmpdir')
2591-
>>> old = tmp.chdir() # changing to a temporary directory
2592-
2593-
.. doctest::
2594-
25952588
>>> import pprint
25962589
>>> from nipype.interfaces.io import JSONFileGrabber
25972590
>>> jsonSource = JSONFileGrabber()
@@ -2603,11 +2596,6 @@ class JSONFileGrabber(IOBase):
26032596
>>> res = jsonSource.run()
26042597
>>> pprint.pprint(res.outputs.get()) # doctest:, +ELLIPSIS
26052598
{'param1': 'exampleStr', 'param2': 4, 'param3': 1.0}
2606-
2607-
.. testsetup::
2608-
2609-
>>> os.chdir(old.strpath)
2610-
26112599
"""
26122600
input_spec = JSONFileGrabberInputSpec
26132601
output_spec = DynamicTraitedSpec

nipype/interfaces/niftyreg/regutils.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,6 @@ class RegAverage(NiftyRegCommand):
450450
Examples
451451
--------
452452
453-
.. testsetup::
454-
455-
>>> tmp = getfixture('tmpdir')
456-
>>> old = tmp.chdir() # changing to temporary file
457-
458-
.. doctest::
459-
460453
>>> from nipype.interfaces import niftyreg
461454
>>> node = niftyreg.RegAverage()
462455
>>> one_file = 'im1.nii'
@@ -465,11 +458,6 @@ class RegAverage(NiftyRegCommand):
465458
>>> node.inputs.avg_files = [one_file, two_file, three_file]
466459
>>> node.cmdline # doctest: +ELLIPSIS
467460
'reg_average --cmd_file .../reg_average_cmd'
468-
469-
.. testsetup::
470-
471-
>>> os.chdir(old.strpath)
472-
473461
"""
474462
_cmd = get_custom_path('reg_average')
475463
input_spec = RegAverageInputSpec

0 commit comments

Comments
 (0)