Skip to content

Commit 41d0eeb

Browse files
authored
MNT: Update tedana pin, test on Python 3.12 (#3141)
With ME-ICA/tedana#998 in a release, we can let bokeh and its dependencies upgrade to their latest versions and start running tests on Python 3.12.
2 parents 742d327 + d6bb667 commit 41d0eeb

File tree

9 files changed

+48
-45
lines changed

9 files changed

+48
-45
lines changed

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: ['ubuntu-latest']
30-
python-version: ['3.10', '3.11']
30+
python-version: ['3.10', '3.11', '3.12']
3131
install: ['pip']
3232
check: ['tests']
3333
pip-flags: ['PRE_PIP_FLAGS']

.github/workflows/stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
matrix:
3232
os: ['ubuntu-latest']
33-
python-version: ['3.10', '3.11']
33+
python-version: ['3.10', '3.11', '3.12']
3434
install: ['pip']
3535
check: ['tests']
3636
pip-flags: ['']

fmriprep/cli/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def main():
202202
_copy_any(dseg_tsv, str(config.execution.fmriprep_dir / "desc-aparcaseg_dseg.tsv"))
203203
errno = 0
204204
finally:
205-
from pkg_resources import resource_filename as pkgrf
205+
from .. import data
206206

207207
# Code Carbon
208208
if config.execution.track_carbon:
@@ -218,7 +218,7 @@ def main():
218218
config.execution.participant_label,
219219
config.execution.fmriprep_dir,
220220
config.execution.run_uuid,
221-
config=pkgrf("fmriprep", "data/reports-spec.yml"),
221+
config=data.load("reports-spec.yml"),
222222
packagename="fmriprep",
223223
)
224224
write_derivative_description(config.execution.bids_dir, config.execution.fmriprep_dir)

fmriprep/cli/workflow.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ def build_workflow(config_file, retval):
3838

3939
from niworkflows.utils.bids import collect_participants
4040
from niworkflows.utils.misc import check_valid_fs_license
41-
from pkg_resources import resource_filename as pkgrf
4241

4342
from fmriprep.reports.core import generate_reports
4443
from fmriprep.utils.bids import check_pipeline_version
4544

46-
from .. import config
45+
from .. import config, data
4746
from ..utils.misc import check_deps
4847
from ..workflows.base import init_fmriprep_wf
4948

@@ -57,7 +56,7 @@ def build_workflow(config_file, retval):
5756
retval["workflow"] = None
5857

5958
banner = [f"Running fMRIPrep version {version}"]
60-
notice_path = Path(pkgrf("fmriprep", "data/NOTICE"))
59+
notice_path = data.load.readable("NOTICE")
6160
if notice_path.exists():
6261
banner[0] += "\n"
6362
banner += [f"License NOTICE {'#' * 50}"]
@@ -91,7 +90,7 @@ def build_workflow(config_file, retval):
9190
config.execution.participant_label,
9291
config.execution.fmriprep_dir,
9392
config.execution.run_uuid,
94-
config=pkgrf("fmriprep", "data/reports-spec.yml"),
93+
config=data.load("reports-spec.yml"),
9594
packagename="fmriprep",
9695
)
9796
return retval
@@ -183,9 +182,9 @@ def build_boilerplate(config_file, workflow):
183182
from pathlib import Path
184183
from subprocess import CalledProcessError, TimeoutExpired, check_call
185184

186-
from pkg_resources import resource_filename as pkgrf
185+
from .. import data
187186

188-
bib_text = Path(pkgrf("fmriprep", "data/boilerplate.bib")).read_text()
187+
bib_text = data.load.readable("boilerplate.bib").read_text()
189188
citation_files["bib"].write_text(
190189
bib_text.replace("fMRIPrep <version>", f"fMRIPrep {config.environment.version}")
191190
)

fmriprep/tests/test_config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727

2828
import pytest
2929
from niworkflows.utils.spaces import format_reference
30-
from pkg_resources import resource_filename as pkgrf
3130
from toml import loads
3231

33-
from .. import config
32+
from .. import config, data
3433

3534

3635
def _reset_config():
@@ -59,8 +58,7 @@ def test_reset_config():
5958

6059
def test_config_spaces():
6160
"""Check that all necessary spaces are recorded in the config."""
62-
filename = Path(pkgrf('fmriprep', 'data/tests/config.toml'))
63-
settings = loads(filename.read_text())
61+
settings = loads(data.load.readable("tests/config.toml").read_text())
6462
for sectionname, configs in settings.items():
6563
if sectionname != 'environment':
6664
section = getattr(config, sectionname)

fmriprep/workflows/bold/registration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
import os.path as op
3434
import typing as ty
3535

36-
import pkg_resources as pkgr
3736
from nipype.interfaces import c3, fsl
3837
from nipype.interfaces import utility as niu
3938
from nipype.pipeline import engine as pe
4039

41-
from ... import config
40+
from ... import config, data
4241
from ...interfaces import DerivativesDataSink
4342

4443
DEFAULT_MEMORY_MIN_GB = config.DEFAULT_MEMORY_MIN_GB
@@ -588,7 +587,7 @@ def init_fsl_bbr_wf(
588587
else:
589588
# Should mostly be hit while building docs
590589
LOGGER.warning("FSLDIR unset - using packaged BBR schedule")
591-
flt_bbr.inputs.schedule = pkgr.resource_filename('fmriprep', 'data/flirtsch/bbr.sch')
590+
flt_bbr.inputs.schedule = data.load('flirtsch/bbr.sch')
592591
# fmt:off
593592
workflow.connect([
594593
(inputnode, wm_mask, [('t1w_dseg', 'in_seg')]),

fmriprep/workflows/tests/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
from pathlib import Path
2828
from tempfile import mkdtemp
2929

30-
from pkg_resources import resource_filename as pkgrf
3130
from toml import loads
3231

32+
from ... import data
33+
3334

3435
@contextmanager
3536
def mock_config():
@@ -40,8 +41,7 @@ def mock_config():
4041
if not _old_fs:
4142
os.environ['FREESURFER_HOME'] = mkdtemp()
4243

43-
filename = Path(pkgrf('fmriprep', 'data/tests/config.toml'))
44-
settings = loads(filename.read_text())
44+
settings = loads(data.load.readable('tests/config.toml').read_text())
4545
for sectionname, configs in settings.items():
4646
if sectionname != 'environment':
4747
section = getattr(config, sectionname)
@@ -52,7 +52,7 @@ def mock_config():
5252
config.init_spaces()
5353

5454
config.execution.work_dir = Path(mkdtemp())
55-
config.execution.bids_dir = Path(pkgrf('fmriprep', 'data/tests/ds000005')).absolute()
55+
config.execution.bids_dir = data.load('tests/ds000005').absolute()
5656
config.execution.fmriprep_dir = Path(mkdtemp())
5757
config.execution.init()
5858

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ classifiers = [
1414
"License :: OSI Approved :: Apache Software License",
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
1718
]
1819
license = {file = "LICENSE"}
1920
requires-python = ">=3.10"
@@ -31,9 +32,9 @@ dependencies = [
3132
"psutil >= 5.4",
3233
"pybids >= 0.15.2",
3334
"requests",
34-
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
35+
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
3536
"smriprep @ git+https://github.com/nipreps/smriprep.git@master",
36-
"tedana >= 0.0.9",
37+
"tedana >= 23.0.2",
3738
"templateflow >= 23.0.0",
3839
"toml",
3940
"codecarbon",

requirements.txt

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ attrs==23.1.0
2323
# sdcflows
2424
bids-validator==1.13.1
2525
# via pybids
26-
bokeh==2.2.3
26+
bokeh==3.3.1
2727
# via tedana
2828
boto==2.49.0
2929
# via datalad
30-
certifi==2023.7.22
30+
certifi==2023.11.17
3131
# via
3232
# requests
3333
# sentry-sdk
@@ -51,7 +51,9 @@ codecarbon==2.3.1
5151
# fmriprep
5252
# fmriprep (pyproject.toml)
5353
contourpy==1.2.0
54-
# via matplotlib
54+
# via
55+
# bokeh
56+
# matplotlib
5557
cryptography==41.0.5
5658
# via secretstorage
5759
cycler==0.12.1
@@ -75,7 +77,7 @@ fasteners==0.19
7577
# via datalad
7678
filelock==3.13.1
7779
# via nipype
78-
fonttools==4.44.0
80+
fonttools==4.45.0
7981
# via matplotlib
8082
formulaic==0.5.2
8183
# via pybids
@@ -91,7 +93,7 @@ humanize==4.8.0
9193
# datalad-next
9294
idna==3.4
9395
# via requests
94-
imageio==2.32.0
96+
imageio==2.33.0
9597
# via scikit-image
9698
importlib-metadata==6.8.0
9799
# via keyring
@@ -116,11 +118,10 @@ jeepney==0.8.0
116118
# via
117119
# keyring
118120
# secretstorage
119-
jinja2==3.0.1
121+
jinja2==3.1.2
120122
# via
121123
# bokeh
122124
# niworkflows
123-
# tedana
124125
joblib==1.3.2
125126
# via
126127
# nilearn
@@ -152,16 +153,18 @@ mapca==0.0.4
152153
# via tedana
153154
markupsafe==2.1.3
154155
# via jinja2
155-
matplotlib==3.8.1
156+
matplotlib==3.8.2
156157
# via
157158
# nireports
158159
# nitime
159160
# niworkflows
160161
# seaborn
161162
# smriprep
162163
# tedana
163-
migas==0.3.0
164-
# via fmriprep
164+
migas==0.4.0
165+
# via
166+
# file:///home/chris/projects/nipreps/fmriprep-ng
167+
# fmriprep
165168
more-itertools==10.1.0
166169
# via jaraco-classes
167170
msgpack==1.0.7
@@ -213,7 +216,7 @@ nitransforms==23.0.1
213216
# fmriprep (pyproject.toml)
214217
# niworkflows
215218
# sdcflows
216-
niworkflows==1.8.1
219+
niworkflows==1.9.0
217220
# via
218221
# fmriprep
219222
# fmriprep (pyproject.toml)
@@ -267,6 +270,7 @@ packaging==23.2
267270
# smriprep
268271
pandas==2.1.3
269272
# via
273+
# bokeh
270274
# codecarbon
271275
# fmriprep
272276
# fmriprep (pyproject.toml)
@@ -277,17 +281,17 @@ pandas==2.1.3
277281
# pybids
278282
# seaborn
279283
# tedana
280-
patool==1.15.0
284+
patool==2.0.0
281285
# via datalad
282-
pillow==10.0.1
286+
pillow==10.1.0
283287
# via
284288
# bokeh
285289
# imageio
286290
# matplotlib
287291
# scikit-image
288292
platformdirs==4.0.0
289293
# via datalad
290-
prometheus-client==0.18.0
294+
prometheus-client==0.19.0
291295
# via codecarbon
292296
prov==2.0.0
293297
# via nipype
@@ -321,7 +325,6 @@ pyparsing==3.1.1
321325
python-dateutil==2.8.2
322326
# via
323327
# arrow
324-
# bokeh
325328
# matplotlib
326329
# nipype
327330
# pandas
@@ -365,7 +368,7 @@ scikit-learn==1.3.2
365368
# mapca
366369
# nilearn
367370
# tedana
368-
scipy==1.11.3
371+
scipy==1.11.4
369372
# via
370373
# formulaic
371374
# mapca
@@ -379,7 +382,7 @@ scipy==1.11.3
379382
# scikit-learn
380383
# sdcflows
381384
# tedana
382-
sdcflows==2.5.1
385+
sdcflows==2.6.0
383386
# via
384387
# fmriprep
385388
# fmriprep (pyproject.toml)
@@ -389,8 +392,10 @@ seaborn==0.13.0
389392
# niworkflows
390393
secretstorage==3.3.3
391394
# via keyring
392-
sentry-sdk==1.35.0
393-
# via fmriprep
395+
sentry-sdk==1.36.0
396+
# via
397+
# file:///home/chris/projects/nipreps/fmriprep-ng
398+
# fmriprep
394399
simplejson==3.19.2
395400
# via nipype
396401
six==1.16.0
@@ -399,7 +404,7 @@ six==1.16.0
399404
# isodate
400405
# osfclient
401406
# python-dateutil
402-
smriprep==0.12.2
407+
smriprep==0.13.0
403408
# via
404409
# fmriprep
405410
# fmriprep (pyproject.toml)
@@ -409,7 +414,7 @@ svgutils==0.3.4
409414
# via
410415
# nireports
411416
# niworkflows
412-
tedana==23.0.1
417+
tedana==23.0.2
413418
# via
414419
# fmriprep
415420
# fmriprep (pyproject.toml)
@@ -449,7 +454,6 @@ types-python-dateutil==2.8.19.14
449454
# via arrow
450455
typing-extensions==4.8.0
451456
# via
452-
# bokeh
453457
# datalad
454458
# formulaic
455459
# sqlalchemy
@@ -463,5 +467,7 @@ urllib3==2.1.0
463467
# sentry-sdk
464468
wrapt==1.16.0
465469
# via formulaic
470+
xyzservices==2023.10.1
471+
# via bokeh
466472
zipp==3.17.0
467473
# via importlib-metadata

0 commit comments

Comments
 (0)