Skip to content

Commit ed8a32c

Browse files
authored
Merge pull request #11 from nipype/develop
fixed up fileformats deps
2 parents da2defd + 5c23148 commit ed8a32c

File tree

11 files changed

+152
-183
lines changed

11 files changed

+152
-183
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,46 @@ name: CI/CD
99
on:
1010
push:
1111
branches: [ main, develop ]
12-
tags: [ '*' ]
1312
pull_request:
1413
branches: [ main, develop ]
14+
release:
15+
types: [published]
1516
repository_dispatch:
16-
types: [create-release]
17+
types: [create-post-release]
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
1723

1824
jobs:
1925

2026
nipype-conv:
2127
runs-on: ubuntu-latest
2228
steps:
29+
2330
- name: Checkout
24-
uses: actions/checkout@v3
25-
- name: Revert version to most recent tag on upstream update
31+
uses: actions/checkout@v4
32+
33+
- name: Revert version to most recent version tag on upstream update
2634
if: github.event_name == 'repository_dispatch'
27-
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v4
35+
run: git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.11'
41+
3042
- name: Install build dependencies
3143
run: python -m pip install --upgrade pip
44+
3245
- name: Install requirements
33-
run: python -m pip install ./related-packages/fileformats -r ./nipype-auto-conv/requirements.txt
46+
run: python -m pip install -r ./nipype-auto-conv/requirements.txt ./related-packages/fileformats
47+
3448
- name: Run automatic Nipype > Pydra conversion
3549
run: ./nipype-auto-conv/generate
36-
- uses: actions/upload-artifact@v3
50+
51+
- uses: actions/upload-artifact@v4
3752
with:
3853
name: converted-nipype
3954
path: pydra/tasks/afni/auto
@@ -43,43 +58,50 @@ jobs:
4358
runs-on: ubuntu-latest
4459
strategy:
4560
matrix:
46-
python-version: ['3.8', '3.11'] # Check oldest and newest versions
61+
python-version: ['3.8', '3.12'] # Check oldest and newest versions
4762
pip-flags: ['', '--editable']
4863
pydra:
4964
- 'pydra'
5065
- '--editable git+https://github.com/nipype/pydra.git#egg=pydra'
5166
steps:
5267
- name: Checkout
53-
uses: actions/checkout@v3
54-
- name: Revert version to most recent tag on upstream update
68+
uses: actions/checkout@v4
69+
70+
- name: Revert version to most recent version tag on Nipype or Nipype2Pydra update
5571
if: github.event_name == 'repository_dispatch'
56-
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
57-
- name: Download tasks converted from Nipype
58-
uses: actions/download-artifact@v3
72+
run: git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
73+
74+
- name: Download tasks converted from Nipype
75+
uses: actions/download-artifact@v4
5976
with:
6077
name: converted-nipype
6178
path: pydra/tasks/afni/auto
6279
- name: Strip auto package from gitignore so it is included in package
6380
run: |
6481
sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
82+
sed -i '/^_version.py/d' .gitignore
6583
- name: Set up Python ${{ matrix.python-version }}
66-
uses: actions/setup-python@v4
84+
uses: actions/setup-python@v5
6785
with:
6886
python-version: ${{ matrix.python-version }}
87+
6988
- name: Install build dependencies
7089
run: |
7190
python -m pip install --upgrade pip
91+
7292
- name: Install Pydra
7393
run: |
7494
pushd $HOME
7595
pip install ${{ matrix.pydra }}
7696
popd
7797
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
98+
7899
- name: Install task package
79100
run: |
80101
pip install "./related-packages/fileformats[dev]" "related-packages/fileformats-extras[dev]"
81102
pip install ${{ matrix.pip-flags }} ".[dev]"
82103
python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
104+
python -c "import pydra.tasks.afni.auto as m; print(f'{m.__name__} @ {m.__file__}')"
83105
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
84106
python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
85107
python -c "import fileformats.extras.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
@@ -88,7 +110,7 @@ jobs:
88110
runs-on: ubuntu-latest
89111
strategy:
90112
matrix:
91-
python-version: ['3.8', '3.11']
113+
python-version: ['3.8', '3.12']
92114
steps:
93115
- uses: actions/checkout@v3
94116
- name: Revert version to most recent tag on upstream update
@@ -106,77 +128,55 @@ jobs:
106128
pip install "./related-packages/fileformats[test]" "./related-packages/fileformats-extras[test]"
107129
python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
108130
- name: Test fileformats with pytest
109-
run: |
110-
cd ./fileformats
111-
pytest -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml .
131+
run: >-
132+
pytest ./related-packages -sv --cov fileformats.medimage_afni
133+
--cov fileformats.extras.medimage_afni --cov-report xml .
112134
113135
test:
114-
needs: [nipype-conv, fileformats-test]
136+
needs: [nipype-conv]
115137
runs-on: ubuntu-22.04
116138
strategy:
117139
matrix:
118-
python-version: ['3.8'] # '3.11'
140+
python-version: ['3.8', '3.12']
119141
steps:
120142
- name: Removed unnecessary tools to free space
121143
run: |
122144
sudo rm -rf /usr/share/dotnet
123145
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
124-
- name: Get Download cache Key
125-
id: cache-key
126-
run: echo "::set-output name=key::afni-linux-ubuntu22_amd64-7.4.1"
127-
- name: Cache FreeSurfer
128-
uses: actions/cache@v2
129-
with:
130-
path: $HOME/downloads/afni
131-
key: ${{ steps.cache-key.outputs.key }}
132-
restore-keys: |
133-
afni-linux-ubuntu22_amd64-7.4.1
134-
- name: Download FreeSurfer
135-
if: steps.cache-key.outputs.key != steps.cache-hit.outputs.key
136-
run: |
137-
mkdir -p $HOME/downloads/afni
138-
curl -s -o $HOME/downloads/afni/afni-linux-ubuntu22_amd64-7.4.1.tar.gz https://surfer.nmr.mgh.harvard.edu/pub/dist/afni/7.4.1/afni-linux-ubuntu22_amd64-7.4.1.tar.gz
139-
shell: bash
140-
- name: Install Freesurfer
141-
env:
142-
FREESURFER_LICENCE: ${{ secrets.FREESURFER_LICENCE }}
143-
run: |
144-
pushd $HOME/downloads/afni
145-
tar -zxpf afni-linux-ubuntu22_amd64-7.4.1.tar.gz
146-
mv afni $HOME/
147-
popd
148-
export FREESURFER_HOME=$HOME/afni
149-
source $FREESURFER_HOME/SetUpFreeSurfer.sh
150-
echo $FREESURFER_LICENCE > $FREESURFER_HOME/license.txt
151-
export PATH=$FREESURFER_HOME/bin:$PATH
152-
- uses: actions/checkout@v3
146+
147+
- uses: actions/checkout@v4
153148
- name: Revert version to most recent tag on upstream update
154149
if: github.event_name == 'repository_dispatch'
155-
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
156-
- name: Download tasks converted from Nipype
157-
uses: actions/download-artifact@v3
150+
run: git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
151+
152+
- name: Download tasks converted from Nipype
153+
uses: actions/download-artifact@v4
158154
with:
159155
name: converted-nipype
160156
path: pydra/tasks/afni/auto
157+
- name: Show package contents
158+
run: tree ./pydra
161159
- name: Strip auto package from gitignore so it is included in package
162160
run: |
163-
sed -i '/\/src\/pydra\/tasks\/afni\/auto/d' .gitignore
161+
sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
164162
- name: Set up Python ${{ matrix.python-version }}
165-
uses: actions/setup-python@v4
163+
uses: actions/setup-python@v5
166164
with:
167165
python-version: ${{ matrix.python-version }}
166+
168167
- name: Install build dependencies
169168
run: |
170169
python -m pip install --upgrade pip
170+
171171
- name: Install task package
172172
run: |
173173
pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ".[test]"
174174
python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
175+
python -c "import pydra.tasks.afni.auto as m; print(f'{m.__name__} @ {m.__file__}')"
175176
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
176177
- name: Test with pytest
177178
run: |
178-
pytest -sv --doctest-modules ./pydra/tasks/afni \
179-
--cov pydra.tasks.afni --cov-report xml
179+
pytest -sv ./pydra/tasks/afni --cov pydra.tasks.afni --cov-report xml
180180
- uses: codecov/codecov-action@v3
181181
if: ${{ always() }}
182182
with:
@@ -256,7 +256,7 @@ jobs:
256256
submodules: recursive
257257
fetch-depth: 0
258258
- name: Download tasks converted from Nipype
259-
uses: actions/download-artifact@v3
259+
uses: actions/download-artifact@v4
260260
with:
261261
name: converted-nipype
262262
path: pydra/tasks/afni/auto
@@ -282,7 +282,7 @@ jobs:
282282
run: python -m build .
283283
- name: Check distributions
284284
run: twine check dist/*
285-
- uses: actions/upload-artifact@v3
285+
- uses: actions/upload-artifact@v4
286286
with:
287287
name: distributions
288288
path: dist/

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,5 @@ dmypy.json
138138
.DS_store
139139

140140
/pydra/tasks/afni/auto
141-
/pydra/tasks/afni/nipype_ports
142141
/pydra/tasks/afni/_version.py
143142
/related-packages/**/_version.py

README.md

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

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
===============================
1+
===========================
22
Pydra task package for afni
3-
===============================
3+
===========================
44

55
.. image:: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml/badge.svg
66
:target: https://github.com/nipype/pydra-afni/actions/workflows/pythonpackage.yaml
@@ -78,7 +78,7 @@ ensure consistent code-style and quality.
7878
.. code-block::
7979
8080
$ pip install -e .[test,dev]
81-
$ pre-commit install
81+
$ pre-commit install
8282
8383
Next install the requirements for running the auto-conversion script and generate the
8484
Pydra task interfaces from their Nipype counterparts

nipype-auto-conv/specs/interfaces/net_corr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inputs:
4949
# type=file|default=<undefined>: can include a whole brain mask within which to calculate correlation. Otherwise, data should be masked already
5050
weight_ts: generic/file
5151
# type=file|default=<undefined>: input a 1D file WTS of weights that will be applied multiplicatively to each ROI's average time series. WTS can be a column- or row-file of values, but it must have the same length as the input time series volume. If the initial average time series was A[n] for n=0,..,(N-1) time points, then applying a set of weights W[n] of the same length from WTS would produce a new time series: B[n] = A[n] * W[n]
52-
out_file: medimage-afni/ncorr
52+
out_file: medimage-afni/n-corr
5353
# type=file|default=<undefined>: output file name part
5454
metadata:
5555
# dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1)

pydra/tasks/afni/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
>>> import pydra.engine
66
>>> import pydra.tasks.afni
77
"""
8+
89
from warnings import warn
910
from pathlib import Path
1011

@@ -19,15 +20,15 @@
1920
)
2021
if "nipype" not in __version__:
2122
try:
22-
from .auto._version import nipype_version, nipype2pydra_version
23+
from .auto._post_release import src_pkg_version, nipype2pydra_version
2324
except ImportError:
2425
warn(
2526
"Nipype interfaces haven't been automatically converted from their specs in "
2627
f"`nipype-auto-conv`. Please run `{str(pkg_path / 'nipype-auto-conv' / 'generate')}` "
2728
"to generated the converted Nipype interfaces in pydra.tasks.afni.auto"
2829
)
2930
else:
30-
n_ver = nipype_version.replace(".", "_")
31+
n_ver = src_pkg_version.replace(".", "_")
3132
n2p_ver = nipype2pydra_version.replace(".", "_")
3233
__version__ += (
3334
"_" if "+" in __version__ else "+"

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ dependencies = [
1212
"fileformats >=0.8.3",
1313
"fileformats-datascience >=0.1",
1414
"fileformats-medimage >=0.4.1",
15-
"fileformats-medimage-afni"
15+
"fileformats-medimage-afni",
16+
"looseversion"
1617
]
1718
license = {file = "LICENSE"}
1819
authors = [{name = "Nipype developers", email = "[email protected]"}]
@@ -44,6 +45,7 @@ doc = [
4445
"sphinxcontrib-versioning",
4546
]
4647
test = [
48+
"nipype2pydra",
4749
"pytest >= 4.4.0",
4850
"pytest-cov",
4951
"pytest-env",

0 commit comments

Comments
 (0)