Skip to content

Commit 9e19349

Browse files
authored
Merge pull request #3066 from effigies/ci/make_checks
CI: make check-before-commit on Travis
2 parents f0a01b5 + 2514026 commit 9e19349

File tree

11 files changed

+43
-25
lines changed

11 files changed

+43
-25
lines changed

.travis.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
1717
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
1818
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
19+
- CHECK_TYPE=test
1920
matrix:
2021
- INSTALL_DEB_DEPENDECIES=true
2122
NIPYPE_EXTRAS="doc,tests,nipy,profiler"
@@ -31,6 +32,13 @@ env:
3132
EXTRA_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
3233
CI_SKIP_TEST=1
3334

35+
matrix:
36+
include:
37+
- python: 3.7
38+
env:
39+
- NIPYPE_EXTRAS=dev
40+
CHECK_TYPE=specs
41+
3442
addons:
3543
apt:
3644
packages:
@@ -64,7 +72,16 @@ install:
6472
- travis_retry pip install pytest-xdist
6573

6674
script:
67-
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype -n auto
75+
- |
76+
if [ "$CHECK_TYPE" = "test" ]; then
77+
py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype -n auto
78+
fi
79+
- |
80+
if [ "$CHECK_TYPE" = "specs" ]; then
81+
make specs
82+
git add nipype
83+
test "$( git diff --cached | wc -l )" -eq 0 || ( git diff --cached && false )
84+
fi
6885
6986
after_script:
7087
- codecov --file cov.xml --flags unittests -e TRAVIS_JOB_NUMBER

nipype/interfaces/afni/tests/test_auto_Remlfit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_Remlfit_inputs():
4646
extensions=None,
4747
),
4848
gltsym=dict(argstr='-gltsym "%s" %s...', ),
49+
goforit=dict(argstr='-GOFORIT', ),
4950
in_files=dict(
5051
argstr='-input "%s"',
5152
copyfile=False,

nipype/interfaces/afni/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3-
# vi: set ft = python sts = 4 ts = 4 sw = 4 et:
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""
55
AFNI utility interfaces.
66
@@ -213,9 +213,9 @@ class Autobox(AFNICommand):
213213
def aggregate_outputs(self, runtime=None, needed_outputs=None):
214214
outputs = super(Autobox, self).aggregate_outputs(
215215
runtime, needed_outputs)
216-
pattern = 'x=(?P<x_min>-?\d+)\.\.(?P<x_max>-?\d+) '\
217-
'y=(?P<y_min>-?\d+)\.\.(?P<y_max>-?\d+) '\
218-
'z=(?P<z_min>-?\d+)\.\.(?P<z_max>-?\d+)'
216+
pattern = r'x=(?P<x_min>-?\d+)\.\.(?P<x_max>-?\d+) '\
217+
r'y=(?P<y_min>-?\d+)\.\.(?P<y_max>-?\d+) '\
218+
r'z=(?P<z_min>-?\d+)\.\.(?P<z_max>-?\d+)'
219219
for line in runtime.stderr.split('\n'):
220220
m = re.search(pattern, line)
221221
if m:

nipype/interfaces/diffusion_toolkit/dti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class DTIRecon(CommandLine):
9494
def _create_gradient_matrix(self, bvecs_file, bvals_file):
9595
_gradient_matrix_file = 'gradient_matrix.txt'
9696
with open(bvals_file) as fbvals:
97-
bvals = [val for val in re.split('\s+', fbvals.readline().strip())]
97+
bvals = [val for val in re.split(r'\s+', fbvals.readline().strip())]
9898
with open(bvecs_file) as fbvecs:
9999
bvecs_x = fbvecs.readline().split()
100100
bvecs_y = fbvecs.readline().split()

nipype/interfaces/dipy/tracks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os.path as op
66
import numpy as np
77
import nibabel as nb
8-
import nibabel.trackvis as nbt
98
from distutils.version import LooseVersion
109

1110
from ... import logging
@@ -89,6 +88,7 @@ class TrackDensityMap(DipyBaseInterface):
8988
def _run_interface(self, runtime):
9089
from numpy import min_scalar_type
9190
from dipy.tracking.utils import density_map
91+
import nibabel.trackvis as nbt
9292

9393
tracks, header = nbt.read(self.inputs.in_file)
9494
streams = ((ii[0]) for ii in tracks)

nipype/interfaces/fsl/utils.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -858,18 +858,18 @@ def _run_interface(self, runtime):
858858
runtime = super(AvScale, self)._run_interface(runtime)
859859

860860
expr = re.compile(
861-
'Rotation\ &\ Translation\ Matrix:\n(?P<rot_tran_mat>[0-9\.\ \n-]+)[\s\n]*'
862-
'(Rotation\ Angles\ \(x,y,z\)\ \[rads\]\ =\ (?P<rot_angles>[0-9\.\ -]+))?[\s\n]*'
863-
'(Translations\ \(x,y,z\)\ \[mm\]\ =\ (?P<translations>[0-9\.\ -]+))?[\s\n]*'
864-
'Scales\ \(x,y,z\)\ =\ (?P<scales>[0-9\.\ -]+)[\s\n]*'
865-
'Skews\ \(xy,xz,yz\)\ =\ (?P<skews>[0-9\.\ -]+)[\s\n]*'
866-
'Average\ scaling\ =\ (?P<avg_scaling>[0-9\.-]+)[\s\n]*'
867-
'Determinant\ =\ (?P<determinant>[0-9\.-]+)[\s\n]*'
868-
'Left-Right\ orientation:\ (?P<lr_orientation>[A-Za-z]+)[\s\n]*'
869-
'Forward\ half\ transform\ =[\s]*\n'
870-
'(?P<fwd_half_xfm>[0-9\.\ \n-]+)[\s\n]*'
871-
'Backward\ half\ transform\ =[\s]*\n'
872-
'(?P<bwd_half_xfm>[0-9\.\ \n-]+)[\s\n]*')
861+
r'Rotation & Translation Matrix:\n(?P<rot_tran_mat>[0-9\. \n-]+)[\s\n]*'
862+
r'(Rotation Angles \(x,y,z\) \[rads\] = (?P<rot_angles>[0-9\. -]+))?[\s\n]*'
863+
r'(Translations \(x,y,z\) \[mm\] = (?P<translations>[0-9\. -]+))?[\s\n]*'
864+
r'Scales \(x,y,z\) = (?P<scales>[0-9\. -]+)[\s\n]*'
865+
r'Skews \(xy,xz,yz\) = (?P<skews>[0-9\. -]+)[\s\n]*'
866+
r'Average scaling = (?P<avg_scaling>[0-9\.-]+)[\s\n]*'
867+
r'Determinant = (?P<determinant>[0-9\.-]+)[\s\n]*'
868+
r'Left-Right orientation: (?P<lr_orientation>[A-Za-z]+)[\s\n]*'
869+
r'Forward half transform =[\s]*\n'
870+
r'(?P<fwd_half_xfm>[0-9\. \n-]+)[\s\n]*'
871+
r'Backward half transform =[\s]*\n'
872+
r'(?P<bwd_half_xfm>[0-9\. \n-]+)[\s\n]*')
873873
out = expr.search(runtime.stdout).groupdict()
874874
outputs = {}
875875
outputs['rotation_translation_matrix'] = [[

nipype/interfaces/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class Rescale(SimpleInterface):
4343
Examples
4444
--------
4545
46-
To use a high-resolution T1w image as a registration target for a T2\*
47-
image, it may be useful to invert the T1w image and rescale to the T2\*
46+
To use a high-resolution T1w image as a registration target for a T2\\*
47+
image, it may be useful to invert the T1w image and rescale to the T2\\*
4848
range.
4949
Using the 1st and 99th percentiles may reduce the impact of outlier
5050
voxels.

nipype/interfaces/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ class DataFinder(IOBase):
14661466
>>> from nipype.interfaces.io import DataFinder
14671467
>>> df = DataFinder()
14681468
>>> df.inputs.root_paths = '.'
1469-
>>> df.inputs.match_regex = '.+/(?P<series_dir>.+(qT1|ep2d_fid_T1).+)/(?P<basename>.+)\.nii.gz'
1469+
>>> df.inputs.match_regex = r'.+/(?P<series_dir>.+(qT1|ep2d_fid_T1).+)/(?P<basename>.+)\.nii.gz'
14701470
>>> result = df.run() # doctest: +SKIP
14711471
>>> result.outputs.out_paths # doctest: +SKIP
14721472
['./027-ep2d_fid_T1_Gd4/acquisition.nii.gz',

nipype/interfaces/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def test_datafinder_unpack(tmpdir):
524524

525525
df = nio.DataFinder()
526526
df.inputs.root_paths = outdir
527-
df.inputs.match_regex = '.+/(?P<basename>.+)\.txt'
527+
df.inputs.match_regex = r'.+/(?P<basename>.+)\.txt'
528528
df.inputs.unpack_single = True
529529
result = df.run()
530530
print(result.outputs.out_paths)

nipype/interfaces/utility/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class Rename(SimpleInterface, IOBase):
254254
255255
>>> rename3 = Rename(format_string="%(subject_id)s_%(seq)s_run%(run)02d.nii")
256256
>>> rename3.inputs.in_file = os.path.join(datadir, "func_epi_1_1.nii")
257-
>>> rename3.inputs.parse_string = "func_(?P<seq>\w*)_.*"
257+
>>> rename3.inputs.parse_string = r"func_(?P<seq>\w*)_.*"
258258
>>> rename3.inputs.subject_id = "subj_201"
259259
>>> rename3.inputs.run = 2
260260
>>> res = rename3.run() # doctest: +SKIP

nipype/pipeline/engine/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def save_resultfile(result, cwd, name, rebase=None):
235235
logger.debug("Saving results file: '%s'", resultsfile)
236236

237237
if result.outputs is None:
238-
logger.warn('Storing result file without outputs')
238+
logger.warning('Storing result file without outputs')
239239
savepkl(resultsfile, result)
240240
return
241241
try:

0 commit comments

Comments
 (0)