16
16
types : [create-release]
17
17
18
18
jobs :
19
-
20
19
nipype-conv :
21
20
runs-on : ubuntu-latest
22
21
steps :
23
22
- name : Checkout
24
- uses : actions/checkout@v3
23
+ uses : actions/checkout@v4
25
24
- name : Revert version to most recent tag on upstream update
26
25
if : github.event_name == 'repository_dispatch'
27
26
run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
27
+ - name : Show file tree
28
+ run : tree .
28
29
- name : Set up Python ${{ matrix.python-version }}
29
- uses : actions/setup-python@v4
30
+ uses : actions/setup-python@v5
30
31
- name : Install build dependencies
31
32
run : python -m pip install --upgrade pip
32
33
- name : Install requirements
33
- run : python -m pip install ./related-packages/fileformats -r ./nipype-auto-conv/requirements.txt
34
+ run : python -m pip install -r ./nipype-auto-conv/requirements.txt
34
35
- name : Run automatic Nipype > Pydra conversion
35
36
run : ./nipype-auto-conv/generate
36
- - uses : actions/upload-artifact@v3
37
+ - uses : actions/upload-artifact@v4
37
38
with :
38
39
name : converted-nipype
39
- path : pydra/tasks/anatomical/auto
40
+ path : pydra/tasks/mriqc
40
41
41
42
devcheck :
42
43
needs : [nipype-conv]
43
44
runs-on : ubuntu-latest
44
45
strategy :
45
46
matrix :
46
- python-version : ['3.8 ', '3.11 '] # Check oldest and newest versions
47
+ python-version : ['3.10 ', '3.12 '] # Check oldest and newest versions
47
48
pip-flags : ['', '--editable']
48
49
pydra :
49
50
- ' pydra'
50
51
- ' --editable git+https://github.com/nipype/pydra.git#egg=pydra'
51
52
steps :
52
53
- name : Checkout
53
- uses : actions/checkout@v3
54
+ uses : actions/checkout@v4
54
55
- name : Revert version to most recent tag on upstream update
55
56
if : github.event_name == 'repository_dispatch'
56
57
run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
57
58
- name : Download tasks converted from Nipype
58
- uses : actions/download-artifact@v3
59
+ uses : actions/download-artifact@v4
59
60
with :
60
61
name : converted-nipype
61
- path : pydra/tasks/anatomical/auto
62
+ path : pydra/tasks/mriqc
62
63
- name : Strip auto package from gitignore so it is included in package
63
64
run : |
64
- sed -i '/\/pydra\/tasks\/anatomical\/auto /d' .gitignore
65
+ sed -i '/\/pydra/d' .gitignore
65
66
- name : Set up Python ${{ matrix.python-version }}
66
- uses : actions/setup-python@v4
67
+ uses : actions/setup-python@v5
67
68
with :
68
69
python-version : ${{ matrix.python-version }}
69
70
- name : Install build dependencies
@@ -77,207 +78,104 @@ jobs:
77
78
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
78
79
- name : Install task package
79
80
run : |
80
- pip install "./related-packages/fileformats[dev]" "related-packages/fileformats-extras[dev]"
81
81
pip install ${{ matrix.pip-flags }} ".[dev]"
82
- python -c "import pydra.tasks.anatomical as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
83
82
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
84
- python -c "import fileformats.medimage_anatomical as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
85
- python -c "import fileformats.extras.medimage_anatomical as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
86
-
87
- fileformats-test :
88
- runs-on : ubuntu-latest
89
- strategy :
90
- matrix :
91
- python-version : ['3.8', '3.11']
92
- steps :
93
- - uses : actions/checkout@v3
94
- - name : Revert version to most recent tag on upstream update
95
- if : github.event_name == 'repository_dispatch'
96
- run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
97
- - name : Set up Python ${{ matrix.python-version }}
98
- uses : actions/setup-python@v4
99
- with :
100
- python-version : ${{ matrix.python-version }}
101
- - name : Install build dependencies
102
- run : |
103
- python -m pip install --upgrade pip
104
- - name : Install task package
105
- run : |
106
- pip install "./related-packages/fileformats[test]" "./related-packages/fileformats-extras[test]"
107
- python -c "import fileformats.medimage_anatomical as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
108
- - name : Test fileformats with pytest
109
- run : |
110
- cd ./fileformats
111
- pytest -sv --cov fileformats.medimage_anatomical --cov fileformats.extras.medimage_anatomical --cov-report xml .
112
83
84
+
113
85
test :
114
- needs : [nipype-conv, fileformats-test ]
86
+ needs : [nipype-conv]
115
87
runs-on : ubuntu-22.04
116
88
strategy :
117
89
matrix :
118
- python-version : ['3.8'] # '3.11'
90
+ python-version : ['3.10', '3.12']
91
+
119
92
steps :
93
+
120
94
- name : Removed unnecessary tools to free space
121
95
run : |
122
96
sudo rm -rf /usr/share/dotnet
123
- sudo rm -rf "$AGENT_TOOLSDIRECTORY"
124
- - name : Get Download cache Key
125
- id : cache-key
126
- run : echo "::set-output name=key::anatomical-linux-ubuntu22_amd64-7.4.1"
127
- - name : Cache FreeSurfer
128
- uses : actions/cache@v2
129
- with :
130
- path : $HOME/downloads/anatomical
131
- key : ${{ steps.cache-key.outputs.key }}
132
- restore-keys : |
133
- anatomical-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/anatomical
138
- curl -s -o $HOME/downloads/anatomical/anatomical-linux-ubuntu22_amd64-7.4.1.tar.gz https://surfer.nmr.mgh.harvard.edu/pub/dist/anatomical/7.4.1/anatomical-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/anatomical
145
- tar -zxpf anatomical-linux-ubuntu22_amd64-7.4.1.tar.gz
146
- mv anatomical $HOME/
147
- popd
148
- export FREESURFER_HOME=$HOME/anatomical
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
97
+ sudo rm -rf "$AGENT_TOOLSDIRECTORY"
98
+
99
+ - uses : actions/checkout@v4
153
100
- name : Revert version to most recent tag on upstream update
154
101
if : github.event_name == 'repository_dispatch'
155
102
run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
103
+
156
104
- name : Download tasks converted from Nipype
157
- uses : actions/download-artifact@v3
105
+ uses : actions/download-artifact@v4
158
106
with :
159
107
name : converted-nipype
160
- path : pydra/tasks/anatomical/auto
161
- - name : Strip auto package from gitignore so it is included in package
108
+ path : pydra/tasks/mriqc
109
+
110
+ - name : Strip pydra package from gitignore so it is included in package
162
111
run : |
163
- sed -i '/\/src\/pydra\/tasks\/anatomical\/auto/d' .gitignore
112
+ sed -i '/\/pydra/d' .gitignore
113
+
164
114
- name : Set up Python ${{ matrix.python-version }}
165
- uses : actions/setup-python@v4
115
+ uses : actions/setup-python@v5
166
116
with :
167
117
python-version : ${{ matrix.python-version }}
118
+
168
119
- name : Install build dependencies
169
120
run : |
170
121
python -m pip install --upgrade pip
122
+
171
123
- name : Install task package
172
124
run : |
173
- pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ". [test]"
174
- python -c "import pydra.tasks.anatomical as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
125
+ pip install ".[test]"
126
+ python -c "import pydra.tasks.mriqc as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
175
127
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
128
+
129
+ - name : Install dev Pydra version for now until it is merged
130
+ run : pip install --upgrade git+https://github.com/nipype/pydra.git@typing-bugfixes
131
+
132
+ - name : Set environment variables required for mocking tools
133
+ run : |
134
+ echo "$(pwd)/mock-tools" >> $GITHUB_PATH
135
+ echo "export FSLDIR=$(pwd)/mock-tools" >> $GITHUB_ENV
136
+ echo "export FSLOUTPUTTYPE=NIFTI_GZ" >> $GITHUB_ENV
137
+
176
138
- name : Test with pytest
177
139
run : |
178
- pytest -sv --doctest-modules ./ pydra/ tasks/anatomical \
179
- --cov pydra.tasks.anatomical --cov-report xml
140
+ pytest -sv ./pydra --cov pydra. tasks.mriqc --cov-report xml
141
+
180
142
- uses : codecov/codecov-action@v3
181
143
if : ${{ always() }}
182
144
with :
183
- files : coverage.xml,./fileformats/coverage.xml
184
- name : pydra-anatomical
185
-
186
- deploy-fileformats :
187
- needs : [devcheck, test]
188
- runs-on : ubuntu-latest
189
- steps :
190
- - uses : actions/checkout@v3
191
- with :
192
- submodules : recursive
193
- fetch-depth : 0
194
- - name : Set up Python
195
- uses : actions/setup-python@v4
196
- with :
197
- python-version : ' 3.11'
198
- - name : Install build tools
199
- run : python -m pip install build twine
200
- - name : Build source and wheel distributions
201
- run : python -m build ./related-packages/fileformats
202
- - name : Check distributions
203
- run : twine check ./related-packages/fileformats/dist/*
204
- - name : Check for PyPI token on tag
205
- id : deployable
206
- if : (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || github.event_name == 'repository_dispatch'
207
- env :
208
- PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_API_TOKEN }}"
209
- run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
210
- - name : Upload to PyPI
211
- if : steps.deployable.outputs.DEPLOY
212
- uses : pypa/gh-action-pypi-publish@release/v1
213
- with :
214
- user : __token__
215
- password : ${{ secrets.PYPI_FILEFORMATS_API_TOKEN }}
216
- packages-dir : ./related-packages/fileformats/dist
217
-
218
- deploy-fileformats-extras :
219
- needs : [deploy-fileformats]
220
- runs-on : ubuntu-latest
221
- steps :
222
- - uses : actions/checkout@v3
223
- with :
224
- submodules : recursive
225
- fetch-depth : 0
226
- - name : Set up Python
227
- uses : actions/setup-python@v4
228
- with :
229
- python-version : ' 3.11'
230
- - name : Install build tools
231
- run : python -m pip install build twine
232
- - name : Build source and wheel distributions
233
- run : python -m build ./related-packages/fileformats-extras
234
- - name : Check distributions
235
- run : twine check ./related-packages/fileformats-extras/dist/*
236
- - name : Check for PyPI token on tag
237
- id : deployable
238
- if : (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || github.event_name == 'repository_dispatch'
239
- env :
240
- PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_EXTRAS_API_TOKEN }}"
241
- run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
242
- - name : Upload to PyPI
243
- if : steps.deployable.outputs.DEPLOY
244
- uses : pypa/gh-action-pypi-publish@release/v1
245
- with :
246
- user : __token__
247
- password : ${{ secrets.PYPI_FILEFORMATS_EXTRAS_API_TOKEN }}
248
- packages-dir : ./related-packages/fileformats-extras/dist
145
+ files : coverage.xml
146
+ name : pydra-mriqc
249
147
250
148
deploy :
251
- needs : [deploy-fileformats-extras ]
149
+ needs : [test ]
252
150
runs-on : ubuntu-latest
253
151
steps :
254
- - uses : actions/checkout@v3
152
+ - uses : actions/checkout@v4
255
153
with :
256
154
submodules : recursive
257
155
fetch-depth : 0
258
156
- name : Download tasks converted from Nipype
259
- uses : actions/download-artifact@v3
157
+ uses : actions/download-artifact@v4
260
158
with :
261
159
name : converted-nipype
262
- path : pydra/tasks/anatomical/auto
160
+ path : pydra/tasks/mriqc
263
161
- name : Tag release with a post-release based on Nipype and Nipype2Pydra versions
264
162
if : github.event_name == 'repository_dispatch'
265
163
run : |
266
164
TAG=$(git tag -l | tail -n 1 | awk -F post '{print $1}')
267
- POST=$(python -c "from pydra.tasks.anatomical.auto._version import *; print(post_release)")
165
+ POST=$(python -c "from pydra.tasks.mriqc._post_release import *; print(post_release)")
268
166
git checkout $TAG
269
- git add -f pydra/tasks/anatomical/auto /_version.py
167
+ git add -f pydra/tasks/mriqc /_version.py
270
168
git commit -am"added auto-generated version to make new tag for package version"
271
169
git tag ${TAG}post${POST}
272
170
- name : Set up Python
273
- uses : actions/setup-python@v4
171
+ uses : actions/setup-python@v5
274
172
with :
275
- python-version : ' 3.11 '
173
+ python-version : ' 3.12 '
276
174
- name : Install build tools
277
175
run : python -m pip install build twine
278
- - name : Strip auto package from gitignore so it is included in package
176
+ - name : Strip pydra package from gitignore so it is included in package
279
177
run : |
280
- sed -i '/\/pydra\/tasks\/anatomical\/auto /d' .gitignore
178
+ sed -i '/\/pydra/d' .gitignore
281
179
- name : Build source and wheel distributions
282
180
run : python -m build .
283
181
- name : Check distributions
@@ -288,7 +186,7 @@ jobs:
288
186
path : dist/
289
187
- name : Check for PyPI token on tag
290
188
id : deployable
291
- if : ( github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || github.event_name == 'repository_dispatch '
189
+ if : github.event_name == 'release '
292
190
env :
293
191
PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
294
192
run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
@@ -302,4 +200,4 @@ jobs:
302
200
# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
303
201
# Secrets are not accessible in the if: condition [0], so set an output variable [1]
304
202
# [0] https://github.community/t/16928
305
- # [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
203
+ # [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
0 commit comments