Skip to content

Commit 4468b3a

Browse files
authored
Merge pull request #2856 from effigies/bf/nopytest
MAINT: Drop pytest-xdist requirement, minimum pytest version
2 parents ebbd062 + 50e2f47 commit 4468b3a

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ before_install:
9494

9595
install:
9696
- travis_retry pip install $EXTRA_PIP_FLAGS -e .[$NIPYPE_EXTRAS]
97+
- travis_retry pip install pytest-xdist
9798

9899
script:
99-
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype
100+
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype -n auto
100101

101102
after_script:
102103
- codecov --file cov.xml --flags unittests -e TRAVIS_JOB_NUMBER

docker/files/run_pytests.sh

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export COVERAGE_FILE=${WORKDIR}/tests/.coverage.py${PYTHON_VERSION}
2929
py.test -v --junitxml=${WORKDIR}/tests/pytests_py${PYTHON_VERSION}.xml \
3030
--cov nipype --cov-config /src/nipype/.coveragerc \
3131
--cov-report xml:${WORKDIR}/tests/coverage_py${PYTHON_VERSION}.xml \
32+
-n auto \
3233
-c ${TESTPATH}/pytest.ini ${TESTPATH}
3334
exit_code=$?
3435

docker/generate_dockerfiles.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function generate_main_dockerfile() {
9292
conda_install='python=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
9393
icu=58.1 libxml2 libxslt matplotlib mkl numpy paramiko
9494
pandas psutil scikit-learn scipy traits=4.6.0' \
95-
pip_install="grabbit==0.1.2 https://github.com/INCF/pybids/tarball/0.6.5" \
95+
pip_install="pytest-xdist" \
9696
activate=true \
9797
--copy docker/files/run_builddocs.sh docker/files/run_examples.sh \
9898
docker/files/run_pytests.sh nipype/external/fsl_imglob.py /usr/bin/ \

nipype/__init__.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@
2525

2626

2727
class NipypeTester(object):
28-
def __call__(self, doctests=True, parallel=True):
28+
def __call__(self, doctests=True, parallel=False):
2929
try:
3030
import pytest
31-
except:
31+
except ImportError:
3232
raise RuntimeError(
3333
'py.test not installed, run: pip install pytest')
3434
args = []
3535
if not doctests:
3636
args.extend(['-p', 'no:doctest'])
37-
if not parallel:
38-
args.append('-n0')
37+
if parallel:
38+
try:
39+
import xdist
40+
except ImportError:
41+
raise RuntimeError(
42+
"pytest-xdist required for parallel run")
43+
args.append('-n auto')
3944
args.append(os.path.dirname(__file__))
4045
pytest.main(args=args)
4146

nipype/info.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def get_nipype_gitversion():
109109
SCIPY_MIN_VERSION = '0.14'
110110
TRAITS_MIN_VERSION = '4.6'
111111
DATEUTIL_MIN_VERSION = '2.2'
112-
PYTEST_MIN_VERSION = '3.6'
113112
FUTURE_MIN_VERSION = '0.16.0'
114113
SIMPLEJSON_MIN_VERSION = '3.8.0'
115114
PROV_VERSION = '1.5.2'
@@ -149,19 +148,16 @@ def get_nipype_gitversion():
149148
'neurdflib',
150149
'click>=%s' % CLICK_MIN_VERSION,
151150
'funcsigs',
152-
'mock',
153151
'pydotplus',
154152
'pydot>=%s' % PYDOT_MIN_VERSION,
155153
'packaging',
156154
'futures; python_version == "2.7"',
155+
'configparser; python_version <= "3.4"',
157156
]
158157

159-
if sys.version_info <= (3, 4):
160-
REQUIRES.append('configparser')
161-
162158
TESTS_REQUIRES = [
163-
'pytest>=%s' % PYTEST_MIN_VERSION,
164-
'pytest-xdist',
159+
'mock',
160+
'pytest',
165161
'pytest-cov',
166162
'codecov',
167163
'pytest-env',

nipype/pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[pytest]
22
norecursedirs = .git build dist doc nipype/external tools examples src
3-
addopts = --doctest-modules -n auto
3+
addopts = --doctest-modules
44
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE
55
env =
66
PYTHONHASHSEED=0

requirements.txt

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ neurdflib
1111
click>=6.6.0
1212
funcsigs
1313
configparser
14-
pytest>=3.0
15-
pytest-xdist
16-
pytest-env
17-
mock
1814
pydotplus
1915
pydot>=1.2.3
2016
packaging

0 commit comments

Comments
 (0)