diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 4dd37e8b9..d45c1779b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest'] - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] install: ['pip'] check: ['tests'] pip-flags: ['PRE_PIP_FLAGS'] diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index bfa3f83e9..ac91887a1 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest'] - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] install: ['pip'] check: ['tests'] pip-flags: [''] diff --git a/fmriprep/cli/run.py b/fmriprep/cli/run.py index ae1b3be62..891284463 100644 --- a/fmriprep/cli/run.py +++ b/fmriprep/cli/run.py @@ -202,7 +202,7 @@ def main(): _copy_any(dseg_tsv, str(config.execution.fmriprep_dir / "desc-aparcaseg_dseg.tsv")) errno = 0 finally: - from pkg_resources import resource_filename as pkgrf + from .. import data # Code Carbon if config.execution.track_carbon: @@ -218,7 +218,7 @@ def main(): config.execution.participant_label, config.execution.fmriprep_dir, config.execution.run_uuid, - config=pkgrf("fmriprep", "data/reports-spec.yml"), + config=data.load("reports-spec.yml"), packagename="fmriprep", ) write_derivative_description(config.execution.bids_dir, config.execution.fmriprep_dir) diff --git a/fmriprep/cli/workflow.py b/fmriprep/cli/workflow.py index 59a4f4972..6d754a93d 100644 --- a/fmriprep/cli/workflow.py +++ b/fmriprep/cli/workflow.py @@ -38,12 +38,11 @@ def build_workflow(config_file, retval): from niworkflows.utils.bids import collect_participants from niworkflows.utils.misc import check_valid_fs_license - from pkg_resources import resource_filename as pkgrf from fmriprep.reports.core import generate_reports from fmriprep.utils.bids import check_pipeline_version - from .. import config + from .. import config, data from ..utils.misc import check_deps from ..workflows.base import init_fmriprep_wf @@ -57,7 +56,7 @@ def build_workflow(config_file, retval): retval["workflow"] = None banner = [f"Running fMRIPrep version {version}"] - notice_path = Path(pkgrf("fmriprep", "data/NOTICE")) + notice_path = data.load.readable("NOTICE") if notice_path.exists(): banner[0] += "\n" banner += [f"License NOTICE {'#' * 50}"] @@ -91,7 +90,7 @@ def build_workflow(config_file, retval): config.execution.participant_label, config.execution.fmriprep_dir, config.execution.run_uuid, - config=pkgrf("fmriprep", "data/reports-spec.yml"), + config=data.load("reports-spec.yml"), packagename="fmriprep", ) return retval @@ -183,9 +182,9 @@ def build_boilerplate(config_file, workflow): from pathlib import Path from subprocess import CalledProcessError, TimeoutExpired, check_call - from pkg_resources import resource_filename as pkgrf + from .. import data - bib_text = Path(pkgrf("fmriprep", "data/boilerplate.bib")).read_text() + bib_text = data.load.readable("boilerplate.bib").read_text() citation_files["bib"].write_text( bib_text.replace("fMRIPrep ", f"fMRIPrep {config.environment.version}") ) diff --git a/fmriprep/tests/test_config.py b/fmriprep/tests/test_config.py index 895598c3d..92b7f0703 100644 --- a/fmriprep/tests/test_config.py +++ b/fmriprep/tests/test_config.py @@ -27,10 +27,9 @@ import pytest from niworkflows.utils.spaces import format_reference -from pkg_resources import resource_filename as pkgrf from toml import loads -from .. import config +from .. import config, data def _reset_config(): @@ -59,8 +58,7 @@ def test_reset_config(): def test_config_spaces(): """Check that all necessary spaces are recorded in the config.""" - filename = Path(pkgrf('fmriprep', 'data/tests/config.toml')) - settings = loads(filename.read_text()) + settings = loads(data.load.readable("tests/config.toml").read_text()) for sectionname, configs in settings.items(): if sectionname != 'environment': section = getattr(config, sectionname) diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index 09cd21349..a2730f339 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -33,12 +33,11 @@ import os.path as op import typing as ty -import pkg_resources as pkgr from nipype.interfaces import c3, fsl from nipype.interfaces import utility as niu from nipype.pipeline import engine as pe -from ... import config +from ... import config, data from ...interfaces import DerivativesDataSink DEFAULT_MEMORY_MIN_GB = config.DEFAULT_MEMORY_MIN_GB @@ -588,7 +587,7 @@ def init_fsl_bbr_wf( else: # Should mostly be hit while building docs LOGGER.warning("FSLDIR unset - using packaged BBR schedule") - flt_bbr.inputs.schedule = pkgr.resource_filename('fmriprep', 'data/flirtsch/bbr.sch') + flt_bbr.inputs.schedule = data.load('flirtsch/bbr.sch') # fmt:off workflow.connect([ (inputnode, wm_mask, [('t1w_dseg', 'in_seg')]), diff --git a/fmriprep/workflows/tests/__init__.py b/fmriprep/workflows/tests/__init__.py index bf1ce32d4..3b8bfc49c 100644 --- a/fmriprep/workflows/tests/__init__.py +++ b/fmriprep/workflows/tests/__init__.py @@ -27,9 +27,10 @@ from pathlib import Path from tempfile import mkdtemp -from pkg_resources import resource_filename as pkgrf from toml import loads +from ... import data + @contextmanager def mock_config(): @@ -40,8 +41,7 @@ def mock_config(): if not _old_fs: os.environ['FREESURFER_HOME'] = mkdtemp() - filename = Path(pkgrf('fmriprep', 'data/tests/config.toml')) - settings = loads(filename.read_text()) + settings = loads(data.load.readable('tests/config.toml').read_text()) for sectionname, configs in settings.items(): if sectionname != 'environment': section = getattr(config, sectionname) @@ -52,7 +52,7 @@ def mock_config(): config.init_spaces() config.execution.work_dir = Path(mkdtemp()) - config.execution.bids_dir = Path(pkgrf('fmriprep', 'data/tests/ds000005')).absolute() + config.execution.bids_dir = data.load('tests/ds000005').absolute() config.execution.fmriprep_dir = Path(mkdtemp()) config.execution.init() diff --git a/pyproject.toml b/pyproject.toml index 520a34c84..090ea5eca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] license = {file = "LICENSE"} requires-python = ">=3.10" @@ -31,9 +32,9 @@ dependencies = [ "psutil >= 5.4", "pybids >= 0.15.2", "requests", - "sdcflows @ git+https://github.com/nipreps/sdcflows.git@master", + "sdcflows @ git+https://github.com/nipreps/sdcflows.git@master", "smriprep @ git+https://github.com/nipreps/smriprep.git@master", - "tedana >= 0.0.9", + "tedana >= 23.0.2", "templateflow >= 23.0.0", "toml", "codecarbon", diff --git a/requirements.txt b/requirements.txt index fd7e75174..189676d7a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,11 +23,11 @@ attrs==23.1.0 # sdcflows bids-validator==1.13.1 # via pybids -bokeh==2.2.3 +bokeh==3.3.1 # via tedana boto==2.49.0 # via datalad -certifi==2023.7.22 +certifi==2023.11.17 # via # requests # sentry-sdk @@ -51,7 +51,9 @@ codecarbon==2.3.1 # fmriprep # fmriprep (pyproject.toml) contourpy==1.2.0 - # via matplotlib + # via + # bokeh + # matplotlib cryptography==41.0.5 # via secretstorage cycler==0.12.1 @@ -75,7 +77,7 @@ fasteners==0.19 # via datalad filelock==3.13.1 # via nipype -fonttools==4.44.0 +fonttools==4.45.0 # via matplotlib formulaic==0.5.2 # via pybids @@ -91,7 +93,7 @@ humanize==4.8.0 # datalad-next idna==3.4 # via requests -imageio==2.32.0 +imageio==2.33.0 # via scikit-image importlib-metadata==6.8.0 # via keyring @@ -116,11 +118,10 @@ jeepney==0.8.0 # via # keyring # secretstorage -jinja2==3.0.1 +jinja2==3.1.2 # via # bokeh # niworkflows - # tedana joblib==1.3.2 # via # nilearn @@ -152,7 +153,7 @@ mapca==0.0.4 # via tedana markupsafe==2.1.3 # via jinja2 -matplotlib==3.8.1 +matplotlib==3.8.2 # via # nireports # nitime @@ -160,8 +161,10 @@ matplotlib==3.8.1 # seaborn # smriprep # tedana -migas==0.3.0 - # via fmriprep +migas==0.4.0 + # via + # file:///home/chris/projects/nipreps/fmriprep-ng + # fmriprep more-itertools==10.1.0 # via jaraco-classes msgpack==1.0.7 @@ -213,7 +216,7 @@ nitransforms==23.0.1 # fmriprep (pyproject.toml) # niworkflows # sdcflows -niworkflows==1.8.1 +niworkflows==1.9.0 # via # fmriprep # fmriprep (pyproject.toml) @@ -267,6 +270,7 @@ packaging==23.2 # smriprep pandas==2.1.3 # via + # bokeh # codecarbon # fmriprep # fmriprep (pyproject.toml) @@ -277,9 +281,9 @@ pandas==2.1.3 # pybids # seaborn # tedana -patool==1.15.0 +patool==2.0.0 # via datalad -pillow==10.0.1 +pillow==10.1.0 # via # bokeh # imageio @@ -287,7 +291,7 @@ pillow==10.0.1 # scikit-image platformdirs==4.0.0 # via datalad -prometheus-client==0.18.0 +prometheus-client==0.19.0 # via codecarbon prov==2.0.0 # via nipype @@ -321,7 +325,6 @@ pyparsing==3.1.1 python-dateutil==2.8.2 # via # arrow - # bokeh # matplotlib # nipype # pandas @@ -365,7 +368,7 @@ scikit-learn==1.3.2 # mapca # nilearn # tedana -scipy==1.11.3 +scipy==1.11.4 # via # formulaic # mapca @@ -379,7 +382,7 @@ scipy==1.11.3 # scikit-learn # sdcflows # tedana -sdcflows==2.5.1 +sdcflows==2.6.0 # via # fmriprep # fmriprep (pyproject.toml) @@ -389,8 +392,10 @@ seaborn==0.13.0 # niworkflows secretstorage==3.3.3 # via keyring -sentry-sdk==1.35.0 - # via fmriprep +sentry-sdk==1.36.0 + # via + # file:///home/chris/projects/nipreps/fmriprep-ng + # fmriprep simplejson==3.19.2 # via nipype six==1.16.0 @@ -399,7 +404,7 @@ six==1.16.0 # isodate # osfclient # python-dateutil -smriprep==0.12.2 +smriprep==0.13.0 # via # fmriprep # fmriprep (pyproject.toml) @@ -409,7 +414,7 @@ svgutils==0.3.4 # via # nireports # niworkflows -tedana==23.0.1 +tedana==23.0.2 # via # fmriprep # fmriprep (pyproject.toml) @@ -449,7 +454,6 @@ types-python-dateutil==2.8.19.14 # via arrow typing-extensions==4.8.0 # via - # bokeh # datalad # formulaic # sqlalchemy @@ -463,5 +467,7 @@ urllib3==2.1.0 # sentry-sdk wrapt==1.16.0 # via formulaic +xyzservices==2023.10.1 + # via bokeh zipp==3.17.0 # via importlib-metadata