Skip to content

Commit 72773fb

Browse files
Revert "Merge remote-tracking branch 'upstream/master' into fix-eddy-parallel-and-gpu"
This reverts commit 176bc81, reversing changes made to 32bd190.
1 parent 176bc81 commit 72773fb

File tree

21 files changed

+103
-298
lines changed

21 files changed

+103
-298
lines changed

.github/workflows/prerelease.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ jobs:
3030
build:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v6
33+
- uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
3636
- name: Install the latest version of uv
37-
uses: astral-sh/setup-uv@v7
37+
uses: astral-sh/setup-uv@v5
3838
- run: uv build
3939
- run: uvx twine check dist/*
40-
- uses: actions/upload-artifact@v7
40+
- uses: actions/upload-artifact@v4
4141
with:
4242
name: dist
4343
path: dist/
@@ -49,32 +49,26 @@ jobs:
4949
matrix:
5050
package: ["wheel", "sdist"]
5151
steps:
52-
- uses: actions/download-artifact@v8
52+
- uses: actions/download-artifact@v4
5353
with:
5454
name: dist
5555
path: dist/
56-
- name: Verify artifacts are present
57-
run: |
58-
ls -l . dist/
59-
wheel_file=$(find dist -name 'nipype-*.whl' | head -n 1)
60-
tar_file=$(find dist -name 'nipype-*.tar.gz' | head -n 1)
61-
62-
echo "WHEEL=$wheel_file" >> $GITHUB_ENV
63-
echo "SDIST=$tar_file" >> $GITHUB_ENV
64-
- name: Install Python
65-
uses: actions/setup-python@v6
56+
- uses: actions/setup-python@v5
6657
with:
67-
python-version: "3.13"
58+
python-version: 3
6859
- name: Display Python version
6960
run: python -c "import sys; print(sys.version)"
61+
- name: Update pip
62+
run: pip install --upgrade pip
7063
- name: Install wheel
71-
run: pip install $WHEEL[tests]
64+
run: pip install dist/nipype-*.whl
7265
if: matrix.package == 'wheel'
7366
- name: Install sdist
74-
run: pip install $SDIST[tests]
67+
run: pip install dist/nipype-*.tar.gz
7568
if: matrix.package == 'sdist'
76-
- name: Display nipype version
77-
run: python -c 'import nipype; print(nipype.__version__)'
69+
- run: python -c 'import nipype; print(nipype.__version__)'
70+
- name: Install test extras
71+
run: pip install nipype[tests]
7872
- name: Run tests
7973
run: pytest --doctest-modules -v --pyargs nipype
8074

@@ -84,59 +78,62 @@ jobs:
8478
strategy:
8579
matrix:
8680
os: ["ubuntu-latest"]
87-
python-version: ["3.10", "3.11", "3.12", "3.13"]
88-
dependencies: [none, full]
81+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
82+
dependencies: [none, full, pre]
8983
include:
9084
- os: ubuntu-latest
91-
python-version: "3.10"
85+
python-version: "3.9"
9286
dependencies: min
9387
exclude:
9488
# Skip some intermediate versions for full tests
95-
- python-version: "3.11"
89+
- python-version: "3.10"
9690
dependencies: full
97-
- python-version: "3.12"
91+
- python-version: "3.11"
9892
dependencies: full
93+
# Do not test pre-releases for versions out of SPEC0
94+
- python-version: "3.9"
95+
dependencies: pre
96+
- python-version: "3.10"
97+
dependencies: pre
9998

10099
env:
101100
DEPENDS: ${{ matrix.dependencies }}
102101

103102
steps:
104-
- uses: actions/checkout@v6
105-
with:
106-
fetch-depth: 0
103+
- uses: actions/checkout@v4
107104
- name: Install the latest version of uv
108-
uses: astral-sh/setup-uv@v7
105+
uses: astral-sh/setup-uv@v5
106+
- name: Set up Python ${{ matrix.python-version }}
107+
uses: actions/setup-python@v5
109108
with:
110109
python-version: ${{ matrix.python-version }}
111110
- name: Display Python version
112111
run: python -c "import sys; print(sys.version)"
113112
- name: Install tox
114113
run: |
115-
uv tool install --with=tox-uv --with=tox-gh-actions tox
114+
uv tool install tox --with=tox-uv --with=tox-gh-actions
116115
- name: Show tox config
117116
run: tox c
118-
- name: Setup test suite
119-
run: tox run -vv --notest
120117
- name: Run tox
121-
run: tox -v --skip-pkg-install --exit-and-dump-after 1200
118+
run: tox -v --exit-and-dump-after 1200
122119
- uses: codecov/codecov-action@v5
123120
with:
124121
token: ${{ secrets.CODECOV_TOKEN }}
125122
if: ${{ always() }}
126123
- name: Upload pytest test results
127-
uses: actions/upload-artifact@v7
124+
uses: actions/upload-artifact@v4
128125
with:
129-
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.dependencies }}
126+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.deb-depends }}
130127
path: test-results.xml
131-
if: always()
128+
if: ${{ always() && matrix.check == 'test' }}
132129

133130
publish:
134131
runs-on: ubuntu-latest
135132
environment: "Package deployment"
136133
needs: [test, test-package]
137134
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
138135
steps:
139-
- uses: actions/download-artifact@v8
136+
- uses: actions/download-artifact@v4
140137
with:
141138
name: dist
142139
path: dist/
@@ -153,12 +150,12 @@ jobs:
153150
check: ['specs', 'style']
154151

155152
steps:
156-
- uses: actions/checkout@v6
153+
- uses: actions/checkout@v4
157154
- name: Install the latest version of uv
158-
uses: astral-sh/setup-uv@v7
159-
- name: Install tox
160-
run: uv tool install --with=tox-uv tox
155+
uses: astral-sh/setup-uv@v5
156+
- name: Show tox config
157+
run: uvx tox c
161158
- name: Show tox config (this call)
162-
run: tox c -e ${{ matrix.check }}
159+
run: uvx tox c -e ${{ matrix.check }}
163160
- name: Run check
164-
run: tox -e ${{ matrix.check }}
161+
run: uvx tox -e ${{ matrix.check }}

.github/workflows/workflow_failure.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ nipype/testing/data/von-ray_errmap.nii.gz
2121
nipype/testing/data/von_errmap.nii.gz
2222
nipype/testing/data/.proc*
2323
crash*.pklz
24-
.coverage*
24+
.coverage
2525
htmlcov/
2626
__pycache__/
2727
*~
@@ -31,7 +31,3 @@ __pycache__/
3131
.pytest_cache
3232
.vscode/
3333
venv/
34-
_version.py
35-
uv.lock
36-
.venv/
37-
.tox/

nipype/conftest.py

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,24 @@
1-
import importlib
21
import os
32
import shutil
4-
import tempfile
3+
from tempfile import mkdtemp
54
import pytest
65
import numpy as np
76
import py.path as pp
87

98
NIPYPE_DATADIR = os.path.realpath(
109
os.path.join(os.path.dirname(__file__), "testing/data")
1110
)
12-
NIPYPE_TMPDIR = tempfile.mkdtemp()
13-
TMP_DATADIR = os.path.join(NIPYPE_TMPDIR, "data")
14-
15-
16-
def pytest_configure(config):
17-
global TMP_DATADIR
18-
# Pytest uses gettempdir() to construct its tmp_paths, but the logic to get
19-
# `pytest-of-<user>/pytest-<n>` directories is contingent on not directly
20-
# configuring the `config.option.base_temp` value.
21-
# Instead of replicating that logic, inject a new directory into gettempdir()
22-
#
23-
# Use the discovered temp dir as a base, to respect user/system settings.
24-
if ' ' not in (base_temp := tempfile.gettempdir()):
25-
new_base = os.path.join(base_temp, "nipype tmp")
26-
os.makedirs(new_base, exist_ok=True)
27-
os.environ['TMPDIR'] = new_base
28-
importlib.reload(tempfile)
29-
assert tempfile.gettempdir() == new_base
30-
TMP_DATADIR = os.path.join(new_base, "data")
31-
32-
# xdist will result in this being run multiple times
33-
if not os.path.exists(TMP_DATADIR):
34-
shutil.copytree(NIPYPE_DATADIR, TMP_DATADIR)
35-
36-
37-
def pytest_unconfigure(config):
38-
shutil.rmtree(NIPYPE_TMPDIR)
39-
40-
41-
if "SUBJECTS_DIR" not in os.environ:
42-
os.environ["SUBJECTS_DIR"] = NIPYPE_TMPDIR
11+
temp_folder = mkdtemp()
12+
data_dir = os.path.join(temp_folder, "data")
13+
shutil.copytree(NIPYPE_DATADIR, data_dir)
4314

4415

4516
@pytest.fixture(autouse=True)
4617
def add_np(doctest_namespace):
4718
doctest_namespace["np"] = np
4819
doctest_namespace["os"] = os
4920
doctest_namespace["pytest"] = pytest
50-
doctest_namespace["datadir"] = TMP_DATADIR
21+
doctest_namespace["datadir"] = data_dir
5122

5223

5324
@pytest.fixture(scope='session', autouse=True)
@@ -62,7 +33,7 @@ def _docdir(request):
6233
doctest_plugin = request.config.pluginmanager.getplugin("doctest")
6334
if isinstance(request.node, doctest_plugin.DoctestItem):
6435
# Get the fixture dynamically by its name.
65-
tmpdir = pp.local(TMP_DATADIR)
36+
tmpdir = pp.local(data_dir)
6637

6738
# Chdir only for the duration of the test.
6839
with tmpdir.as_cwd():
@@ -71,3 +42,8 @@ def _docdir(request):
7142
else:
7243
# For normal tests, we have to yield, since this is a yield-fixture.
7344
yield
45+
46+
47+
def pytest_unconfigure(config):
48+
# Delete temp folder after session is finished
49+
shutil.rmtree(temp_folder)

nipype/interfaces/afni/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,9 +2860,9 @@ class TNorm(AFNICommand):
28602860
>>> tnorm = afni.TNorm()
28612861
>>> tnorm.inputs.in_file = 'functional.nii'
28622862
>>> tnorm.inputs.norm2 = True
2863-
>>> tnorm.inputs.out_file = 'errts+tlrc'
2863+
>>> tnorm.inputs.out_file = 'rm.errts.unit errts+tlrc'
28642864
>>> tnorm.cmdline
2865-
'3dTnorm -norm2 -prefix errts+tlrc functional.nii'
2865+
'3dTnorm -norm2 -prefix rm.errts.unit errts+tlrc functional.nii'
28662866
>>> res = tshift.run() # doctest: +SKIP
28672867
28682868
"""

nipype/interfaces/ants/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ class LabelGeometry(ANTSCommand):
928928
>>> label_extract.inputs.dimension = 3
929929
>>> label_extract.inputs.label_image = 'atlas.nii.gz'
930930
>>> label_extract.cmdline
931-
"LabelGeometryMeasures 3 atlas.nii.gz '[]' atlas.csv"
931+
'LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv'
932932
933933
>>> label_extract.inputs.intensity_image = 'ants_Warp.nii.gz'
934934
>>> label_extract.cmdline

nipype/interfaces/ants/visualization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ConvertScalarImageToRGBInputSpec(ANTSCommandInputSpec):
2828
)
2929
mask_image = traits.Either(
3030
"none",
31-
File(exists=True),
31+
traits.File(exists=True),
3232
argstr="%s",
3333
desc="mask image",
3434
position=3,

0 commit comments

Comments
 (0)