Skip to content

Commit 1b12a27

Browse files
committed
Merge remote-tracking branch 'upstream/master' into addSPMrealingUnwarp
2 parents 3f6c5d2 + 297a24c commit 1b12a27

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

.circleci/config.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,25 @@ jobs:
339339
- run:
340340
name: Check pypi preconditions
341341
command: |
342-
pip install twine future wheel readme_renderer
342+
pip install --upgrade twine future wheel readme_renderer setuptools
343343
python setup.py check -r -s
344344
python setup.py sdist bdist_wheel
345+
- run:
346+
name: Validate Python 2 installation
347+
command: |
348+
pyenv local 2.7.12
349+
pip install dist/nipype-*-py2.py3-none-any.whl
350+
# Futures should install in Python 2
351+
pip show futures 2>/dev/null | grep "Name: futures"
352+
- run:
353+
name: Validate Python 3 installation
354+
command: |
355+
pyenv local 3.5.2
356+
pip install dist/nipype-*-py2.py3-none-any.whl
357+
# Futures should not install in Python 3
358+
test $(pip show futures 2>/dev/null | wc -l) = "0"
359+
- store_artifacts:
360+
path: /home/circleci/nipype/dist
345361

346362
deploy_pypi:
347363
machine: *machine_kwds
@@ -352,7 +368,7 @@ jobs:
352368
- run:
353369
name: Deploy to PyPI
354370
command: |
355-
pip install twine future wheel readme_renderer
371+
pip install --upgrade twine future wheel readme_renderer setuptools
356372
python setup.py check -r -s
357373
python setup.py sdist bdist_wheel
358374
twine upload dist/*
@@ -393,6 +409,7 @@ workflows:
393409
version: 2
394410
build_test_deploy:
395411
jobs:
412+
- pypi_precheck
396413
- compare_base_dockerfiles:
397414
filters:
398415
tags:
@@ -428,6 +445,7 @@ workflows:
428445
tags:
429446
only: /.*/
430447
requires:
448+
- pypi_precheck
431449
- test_pytest
432450
- update_feedstock:
433451
context: nipybot
@@ -436,7 +454,3 @@ workflows:
436454
only: /rel\/.*/
437455
tags:
438456
only: /.*/
439-
- pypi_precheck:
440-
filters:
441-
branches:
442-
only: /rel\/.*/

nipype/interfaces/io.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@
4242

4343
have_pybids = True
4444
try:
45-
from bids import grabbids as gb
45+
import bids
4646
except ImportError:
4747
have_pybids = False
4848

49+
if have_pybids:
50+
try:
51+
from bids import layout as bidslayout
52+
except ImportError:
53+
from bids import grabbids as bidslayout
54+
4955
try:
5056
import pyxnat
5157
except:
@@ -2810,7 +2816,7 @@ def __init__(self, infields=None, **kwargs):
28102816

28112817
# If infields is empty, use all BIDS entities
28122818
if infields is None and have_pybids:
2813-
bids_config = join(dirname(gb.__file__), 'config', 'bids.json')
2819+
bids_config = join(dirname(bidslayout.__file__), 'config', 'bids.json')
28142820
bids_config = json.load(open(bids_config, 'r'))
28152821
infields = [i['name'] for i in bids_config['entities']]
28162822

@@ -2835,7 +2841,7 @@ def _list_outputs(self):
28352841
exclude = None
28362842
if self.inputs.strict:
28372843
exclude = ['derivatives/', 'code/', 'sourcedata/']
2838-
layout = gb.BIDSLayout(self.inputs.base_dir, exclude=exclude)
2844+
layout = bidslayout.BIDSLayout(self.inputs.base_dir, exclude=exclude)
28392845

28402846
# If infield is not given nm input value, silently ignore
28412847
filters = {}

nipype/interfaces/tests/test_io.py

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
have_pybids = True
7878
try:
7979
import bids
80-
from bids import grabbids as gb
8180
filepath = os.path.realpath(os.path.dirname(bids.__file__))
8281
datadir = os.path.realpath(os.path.join(filepath, 'tests/data/'))
8382
except ImportError:

0 commit comments

Comments
 (0)