Skip to content

Commit 345f836

Browse files
committed
Merge remote-tracking branch 'upstream/master' into enh/fs_long
2 parents be0cefc + 45c2e2f commit 345f836

25 files changed

+372
-162
lines changed

.circleci/config.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ _machine_defaults: &machine_defaults
44
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
55
SCRATCH: "/scratch"
66
machine:
7-
image: ubuntu-2204:2023.04.2
7+
image: default
88
docker_layer_caching: true
99
working_directory: /tmp/src/smriprep
1010
resource_class: large
1111

1212
_python_defaults: &python_defaults
1313
docker:
14-
- image: cimg/python:3.10.9
14+
- image: cimg/python:3.12.2
1515
auth:
1616
username: $DOCKER_USER
1717
password: $DOCKER_PAT
@@ -115,8 +115,7 @@ jobs:
115115
name: Build Docker image
116116
no_output_timeout: 60m
117117
command: |
118-
export PY3=$( pyenv versions | awk '/^\* 3/ { print $2 }' )
119-
pyenv local $PY3
118+
pyenv local 3
120119
pip install hatch
121120
# Get version, update files.
122121
THISVERSION=$( hatch version )
@@ -139,8 +138,7 @@ jobs:
139138
- run:
140139
name: Check Docker image
141140
command: |
142-
export PY3=$( pyenv versions | awk '/^\* 3/ { print $2 }' )
143-
pyenv local $PY3
141+
pyenv local 3
144142
# Get version, update files.
145143
THISVERSION=$( hatch version )
146144
BUILT_VERSION=$( docker run --rm nipreps/smriprep:latest --version )
@@ -309,8 +307,7 @@ jobs:
309307
- run:
310308
name: Test smriprep-wrapper (Python 2)
311309
command: |
312-
export PY2=$( pyenv versions | awk '/^\* 2/ { print $2 }' )
313-
pyenv local $PY2
310+
pyenv local 2.7
314311
echo -n "Python version: "
315312
python --version
316313
pip install --upgrade "pip<21"
@@ -322,8 +319,7 @@ jobs:
322319
- run:
323320
name: Test smriprep-wrapper (Python 3)
324321
command: |
325-
export PY3=$( pyenv versions | awk '/^\* 3/ { print $2 }' )
326-
pyenv local $PY3
322+
pyenv local 3
327323
echo -n "Python version: "
328324
python --version
329325
pip install --upgrade pip setuptools
@@ -440,10 +436,10 @@ jobs:
440436
- run: *pull_from_registry
441437
- restore_cache:
442438
keys:
443-
- ds005-anat-v0-{{ .Branch }}-{{ epoch }}
444-
- ds005-anat-v0-{{ .Branch }}
445-
- ds005-anat-v0-master
446-
- ds005-anat-v0-next
439+
- ds005-anat-v1-{{ .Branch }}-{{ epoch }}
440+
- ds005-anat-v1-{{ .Branch }}
441+
- ds005-anat-v1-master
442+
- ds005-anat-v1-next
447443
- restore_cache:
448444
keys:
449445
- testdata-v2-{{ .Branch }}-{{ epoch }}
@@ -500,7 +496,7 @@ jobs:
500496
rm -rf /tmp/ds005/work/reportlets
501497
rm -rf /tmp/ds005/work/smriprep_wf/fsdir_run_*/
502498
- save_cache:
503-
key: ds005-anat-v0-{{ .Branch }}-{{ epoch }}
499+
key: ds005-anat-v1-{{ .Branch }}-{{ epoch }}
504500
paths:
505501
- /tmp/ds005/work
506502

@@ -509,7 +505,8 @@ jobs:
509505
command: |
510506
mkdir -p /tmp/ds005/test
511507
find /tmp/ds005/derivatives -name "*" ! -path "*/figures*" -print | sed s+/tmp/ds005/derivatives/++ | sort > /tmp/ds005/test/outputs.out
512-
diff /tmp/src/smriprep/.circleci/ds005_outputs.txt /tmp/ds005/test/outputs.out
508+
sort /tmp/src/smriprep/.circleci/ds005_outputs.txt > /tmp/ds005/test/expected.out
509+
diff /tmp/ds005/test/{expected,outputs}.out
513510
exit $?
514511
- store_artifacts:
515512
path: /tmp/ds005/derivatives
@@ -658,7 +655,8 @@ jobs:
658655
command: |
659656
mkdir -p /tmp/ds054/test
660657
find /tmp/ds054/derivatives -path */figures -prune -o -name "*" -print | sed s+/tmp/ds054/derivatives/++ | sort > /tmp/ds054/test/outputs.out
661-
diff /tmp/src/smriprep/.circleci/ds054_outputs.txt /tmp/ds054/test/outputs.out
658+
sort /tmp/src/smriprep/.circleci/ds054_outputs.txt > /tmp/ds054/test/expected.out
659+
diff /tmp/ds054/test/{expected,outputs}.out
662660
exit $?
663661
- run:
664662
name: Clean working directory

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 2024-03-07 - [email protected] - STY: ruff format smriprep [git-blame-ignore-rev]
2+
83a50d465145c6e8176c3f13d4673ed4e0bdb26f
13
# 2023-11-21 - [email protected] - STY: ruff --fix smriprep [git-blame-ignore-rev]
24
3a586cf46cb1bb963b93d9546f20273194d15de5
35
# 2023-11-20 - [email protected] - STY: ruff --fix smriprep [git-blame-ignore-rev]

.github/workflows/pythonpackage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ jobs:
109109
run: python -m pip install "smriprep[tests]"
110110
- name: Run tests
111111
run: pytest -sv --doctest-modules --cov smriprep --pyargs smriprep
112-
- uses: codecov/codecov-action@v3
112+
- uses: codecov/codecov-action@v4
113113
name: Submit to CodeCov
114+
with:
115+
token: ${{ secrets.CODECOV_TOKEN }}
114116

115117
style:
116118
if: "!contains(github.event.head_commit.message, '[skip ci]')"
117119
runs-on: ubuntu-latest
118120
steps:
119121
- uses: actions/checkout@v4
120-
- run: pipx run ruff smriprep
122+
- run: pipx run ruff check smriprep
121123
- run: pipx run ruff format --diff smriprep

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: check-toml
1212
- id: check-json
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.1.6
14+
rev: v0.3.1
1515
hooks:
1616
- id: ruff
1717
- id: ruff-format

CHANGES.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
0.14.0 (March 11, 2024)
2+
=======================
3+
New feature release in the 0.14.x series.
4+
5+
This release restores correct handling of cohort identifiers in templates.
6+
A feature release is warranted due to changes in the workflow structure.
7+
8+
* FIX: Fetch templates during workflow construction (#418)
9+
* FIX: Re-add cohort identifier to template name (#416)
10+
* FIX: Repair FreeSurfer Dependency in Dockerfile (tcsh) (#404)
11+
* FIX: Invert result of skull-strip check in auto mode (#402)
12+
* STY: Adopt ruff for linting and formatting (#397)
13+
* CHORE: Update ruff, ignore certain rules (#419)
14+
15+
116
0.13.2 (December 08, 2023)
217
==========================
318
Bug fix release in the 0.13.x series.

Dockerfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# MIT License
44
#
5-
# Copyright (c) 2023 The NiPreps Developers
5+
# Copyright (c) The NiPreps Developers
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy
88
# of this software and associated documentation files (the "Software"), to deal
@@ -23,24 +23,26 @@
2323
# SOFTWARE.
2424

2525
# Ubuntu 22.04 LTS - Jammy
26-
ARG BASE_IMAGE=ubuntu:jammy-20230308
26+
ARG BASE_IMAGE=ubuntu:jammy-20240125
2727

2828
#
29-
# sMRIPrep wheel
29+
# Build wheel
3030
#
3131
FROM python:slim AS src
3232
RUN pip install build
3333
RUN apt-get update && \
3434
apt-get install -y --no-install-recommends git
35-
COPY . /src/smriprep
36-
RUN python -m build /src/smriprep
35+
COPY . /src
36+
RUN python -m build /src
3737

3838
#
3939
# Download stages
4040
#
4141

4242
# Utilities for downloading packages
4343
FROM ${BASE_IMAGE} as downloader
44+
# Bump the date to current to refresh curl/certificates/etc
45+
RUN echo "2023.07.20"
4446
RUN apt-get update && \
4547
apt-get install -y --no-install-recommends \
4648
binutils \
@@ -67,19 +69,30 @@ RUN mkdir /opt/workbench && \
6769

6870
# Micromamba
6971
FROM downloader as micromamba
72+
73+
# Install a C compiler to build extensions when needed.
74+
# traits<6.4 wheels are not available for Python 3.11+, but build easily.
75+
RUN apt-get update && \
76+
apt-get install -y --no-install-recommends build-essential && \
77+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
78+
7079
WORKDIR /
7180
# Bump the date to current to force update micromamba
72-
RUN echo "2023.04.05"
81+
RUN echo "2024.03.08"
7382
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
7483

7584
ENV MAMBA_ROOT_PREFIX="/opt/conda"
7685
COPY env.yml /tmp/env.yml
7786
COPY requirements.txt /tmp/requirements.txt
87+
WORKDIR /tmp
7888
RUN micromamba create -y -f /tmp/env.yml && \
7989
micromamba clean -y -a
8090

81-
ENV PATH="/opt/conda/envs/smriprep/bin:$PATH"
82-
RUN /opt/conda/envs/smriprep/bin/npm install -g svgo@^3.0 bids-validator@^1.13 && \
91+
# UV_USE_IO_URING for apparent race-condition (https://github.com/nodejs/node/issues/48444)
92+
# Check if this is still necessary when updating the base image.
93+
ENV PATH="/opt/conda/envs/smriprep/bin:$PATH" \
94+
UV_USE_IO_URING=0
95+
RUN npm install -g svgo@^3.2.0 bids-validator@^1.14.0 && \
8396
rm -r ~/.npm
8497

8598
#
@@ -179,7 +192,7 @@ ENV MKL_NUM_THREADS=1 \
179192
OMP_NUM_THREADS=1
180193

181194
# Installing SMRIPREP
182-
COPY --from=src /src/smriprep/dist/*.whl .
195+
COPY --from=src /src/dist/*.whl .
183196
RUN pip install --no-cache-dir $( ls *.whl )[telemetry,test]
184197

185198
RUN find $HOME -type d -exec chmod go=u {} + && \

env.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ name: smriprep
22
channels:
33
- https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
44
- conda-forge
5-
# Update this ~yearly; last updated April 2023
5+
# Update this ~yearly; last updated March 2024
66
dependencies:
7-
- python=3.10
7+
- python=3.11
88
# Needed for svgo and bids-validator; consider moving to deno
9-
- nodejs=18
9+
- nodejs=20
1010
# Intel Math Kernel Library for numpy
11-
- mkl=2022.1
11+
- mkl=2023.2
1212
- mkl-service=2.4
1313
# Base scientific python stack; required by FSL, so pinned here
1414
- numpy=1.26
1515
- scipy=1.11
1616
- matplotlib=3.8
17-
- pandas=2.1
17+
- pandas=2.2
1818
- h5py=3.10
1919
# Dependencies compiled against numpy, best to stick with conda
2020
- scikit-image=0.22
21-
- scikit-learn=1.3
21+
- scikit-learn=1.4
2222
# Utilities
23-
- graphviz=6.0
23+
- graphviz=9.0
2424
- pandoc=3.1
2525
# Workflow dependencies: ANTs
26-
- ants=2.5.0
27-
# Workflow dependencies: FSL (versions pinned in 6.0.6.2)
26+
- ants=2.5
27+
# Workflow dependencies: FSL (versions pinned in 6.0.7.7)
2828
- fsl-bet2=2111.4
2929
- fsl-flirt=2111.2
3030
- fsl-fast4=2111.3

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"matplotlib >= 2.2.0",
2626
"nibabel >= 4.0.1",
2727
"nipype >= 1.7.0",
28-
"niworkflows >= 1.8.0",
28+
"niworkflows >= 1.10.1",
2929
"numpy",
3030
"packaging",
3131
"pybids >= 0.11.1",
@@ -138,6 +138,8 @@ source = [
138138

139139
[tool.ruff]
140140
line-length = 99
141+
142+
[tool.ruff.lint]
141143
extend-select = [
142144
"F",
143145
"E",
@@ -161,11 +163,16 @@ extend-select = [
161163
"PT",
162164
"Q",
163165
]
166+
extend-ignore = [
167+
"S311", # We are not using random for cryptographic purposes
168+
"ISC001",
169+
"S603",
170+
]
164171

165-
[tool.ruff.flake8-quotes]
172+
[tool.ruff.lint.flake8-quotes]
166173
inline-quotes = "single"
167174

168-
[tool.ruff.extend-per-file-ignores]
175+
[tool.ruff.lint.extend-per-file-ignores]
169176
"*/test_*.py" = ["S101"]
170177

171178
[tool.ruff.format]

0 commit comments

Comments
 (0)