Skip to content

Commit 152a80d

Browse files
authored
chore: Update minimum dependencies, test with tox-uv (#3412)
This is narrowly targeted to get tests passing. Python 3.13 support depends on a new release of sdcflows. Will work on that today.
2 parents 3e77638 + e6b5fcb commit 152a80d

File tree

12 files changed

+71
-88
lines changed

12 files changed

+71
-88
lines changed

.github/workflows/contrib.yml

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

.github/workflows/test.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
run: |
5858
sudo apt update
5959
sudo apt install -y --no-install-recommends graphviz
60+
- name: Install the latest version of uv
61+
uses: astral-sh/setup-uv@v4
6062
- name: Set up Python ${{ matrix.python-version }}
6163
uses: actions/setup-python@v5
6264
with:
@@ -65,14 +67,32 @@ jobs:
6567
run: python -c "import sys; print(sys.version)"
6668
- name: Install tox
6769
run: |
68-
python -m pip install --upgrade pip
69-
python -m pip install tox tox-gh-actions
70+
uv tool install --with=tox-uv --with=tox-gh-actions tox
7071
- name: Show tox config
7172
run: tox c
7273
- name: Run tox
7374
run: tox -v --exit-and-dump-after 1200
7475
- uses: codecov/codecov-action@v5
7576
with:
76-
file: coverage.xml
7777
token: ${{ secrets.CODECOV_TOKEN }}
7878
if: ${{ always() }}
79+
80+
checks:
81+
runs-on: "ubuntu-latest"
82+
continue-on-error: true
83+
strategy:
84+
matrix:
85+
check: ["style", "spellcheck"]
86+
87+
steps:
88+
- uses: actions/checkout@v4
89+
with:
90+
persist-credentials: false
91+
- name: Install the latest version of uv
92+
uses: astral-sh/setup-uv@v4
93+
- name: Install tox
94+
run: uv tool install tox --with=tox-uv
95+
- name: Show tox config
96+
run: tox c -e ${{ matrix.check }}
97+
- name: Run check
98+
run: tox -e ${{ matrix.check }}

.maint/paper_author_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _aslist(inlist):
3838
aff_indexes = [
3939
', '.join(
4040
[
41-
'%d' % (affiliations.index(a) + 1)
41+
str(affiliations.index(a) + 1)
4242
for a in _aslist(author.get('affiliation', 'Unaffiliated'))
4343
]
4444
)
@@ -52,7 +52,7 @@ def _aslist(inlist):
5252
file=sys.stderr,
5353
)
5454

55-
print('Authors (%d):' % len(author_matches))
55+
print(f'Authors ({len(author_matches)}):')
5656
print(
5757
'{}.'.format(
5858
'; '.join(

.maint/update_authors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def _aslist(value):
259259
aff_indexes = [
260260
', '.join(
261261
[
262-
'%d' % (affiliations.index(a) + 1)
262+
str(affiliations.index(a) + 1)
263263
for a in _aslist(author.get('affiliation', 'Unaffiliated'))
264264
]
265265
)
@@ -272,7 +272,7 @@ def _aslist(value):
272272
file=sys.stderr,
273273
)
274274

275-
print('Authors (%d):' % len(hits))
275+
print(f'Authors ({len(hits)}):')
276276
print(
277277
'{}.'.format(
278278
'; '.join(

fmriprep/cli/tests/test_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ def test_parser_valid(tmp_path, args):
8282
('1000MB', 1),
8383
('1T', 1000),
8484
('1TB', 1000),
85-
('%dK' % 1e6, 1),
86-
('%dKB' % 1e6, 1),
87-
('%dB' % 1e9, 1),
85+
('1000000K', 1),
86+
('1000000KB', 1),
87+
('1000000000B', 1),
8888
],
8989
)
9090
def test_memory_arg(tmp_path, argval, gb):

fmriprep/config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,10 @@
149149
# Just get so analytics track one hit
150150
from contextlib import suppress
151151

152-
from requests import ConnectionError, ReadTimeout
153-
from requests import get as _get_url
152+
import requests
154153

155-
with suppress((ConnectionError, ReadTimeout)):
156-
_get_url('https://rig.mit.edu/et/projects/nipy/nipype', timeout=0.05)
154+
with suppress((requests.ConnectionError, requests.ReadTimeout)):
155+
requests.get('https://rig.mit.edu/et/projects/nipy/nipype', timeout=0.05)
157156

158157
# Execution environment
159158
_exec_env = os.name

fmriprep/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def copytree_or_skip(source, target):
2626
pytest.skip(f'Cannot copy {data_dir!r} into {target / data_dir.name}. Probably in a zip.')
2727

2828

29+
@pytest.fixture(scope='session', autouse=True)
30+
def _legacy_printoptions():
31+
np.set_printoptions(legacy='1.21')
32+
33+
2934
@pytest.fixture(autouse=True)
3035
def _populate_namespace(doctest_namespace, tmp_path):
3136
doctest_namespace['copytree_or_skip'] = copytree_or_skip

fmriprep/interfaces/reports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ def _generate_segment(self):
242242
reg = {
243243
'FSL': [
244244
'FSL <code>flirt</code> with boundary-based registration'
245-
' (BBR) metric - %d dof' % dof,
245+
f' (BBR) metric - {dof} dof',
246246
'FSL <code>flirt</code> rigid registration - 6 dof',
247247
],
248248
'FreeSurfer': [
249249
'FreeSurfer <code>bbregister</code> '
250-
'(boundary-based registration, BBR) - %d dof' % dof,
251-
'FreeSurfer <code>mri_coreg</code> - %d dof' % dof,
250+
f'(boundary-based registration, BBR) - {dof} dof',
251+
f'FreeSurfer <code>mri_coreg</code> - {dof} dof',
252252
],
253253
}[self.inputs.registration][self.inputs.fallback]
254254

fmriprep/utils/telemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def process_crashfile(crashfile):
116116
scope.set_extra(k, strv[0])
117117
else:
118118
for i, chunk in enumerate(strv):
119-
scope.set_extra('%s_%02d' % (k, i), chunk)
119+
scope.set_extra(f'{k}_{i:02d}', chunk)
120120

121121
fingerprint = ''
122122
issue_title = f'{node_name}: {gist}'

fmriprep/workflows/bold/stc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def init_bold_stc_wf(
106106
frac = config.workflow.slice_time_ref
107107
tzero = np.round(first + frac * (last - first), 3)
108108

109-
afni_ver = ''.join('%02d' % v for v in afni.Info().version() or [])
109+
afni_ver = ''.join(f'{v:02d}' for v in afni.Info().version() or [])
110110
workflow = Workflow(name=name)
111111
workflow.__desc__ = f"""\
112112
BOLD runs were slice-time corrected to {tzero:0.3g}s ({frac:g} of slice acquisition range

0 commit comments

Comments
 (0)