Skip to content

Commit 560a5be

Browse files
authored
Merge branch 'master' into freesurfer-realras-flex
2 parents 7eaad8e + 70f278e commit 560a5be

File tree

18 files changed

+2475
-114
lines changed

18 files changed

+2475
-114
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
build:
4242
runs-on: ubuntu-latest
4343
steps:
44-
- uses: actions/checkout@v4
44+
- uses: actions/checkout@v5
4545
with:
4646
fetch-depth: 0
4747
- uses: actions/setup-python@v5
@@ -73,13 +73,13 @@ jobs:
7373
steps:
7474
- name: Download sdist and wheel artifacts
7575
if: matrix.package != 'archive'
76-
uses: actions/download-artifact@v4
76+
uses: actions/download-artifact@v5
7777
with:
7878
name: dist
7979
path: dist/
8080
- name: Download git archive artifact
8181
if: matrix.package == 'archive'
82-
uses: actions/download-artifact@v4
82+
uses: actions/download-artifact@v5
8383
with:
8484
name: archive
8585
path: archive/
@@ -113,7 +113,15 @@ jobs:
113113
fail-fast: false
114114
matrix:
115115
os: ['ubuntu-latest', 'windows-latest', 'macos-13', 'macos-latest']
116-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
116+
python-version:
117+
- "3.9"
118+
- "3.10"
119+
- "3.11"
120+
- "3.12"
121+
- "3.13"
122+
- "3.13t"
123+
- "3.14"
124+
- "3.14t"
117125
architecture: ['x86', 'x64', 'arm64']
118126
dependencies: ['full', 'pre']
119127
include:
@@ -127,6 +135,11 @@ jobs:
127135
python-version: "3.9"
128136
architecture: 'x64'
129137
dependencies: 'min'
138+
# Absolute minimum dependencies
139+
- os: ubuntu-latest
140+
python-version: "3.10"
141+
architecture: 'x64'
142+
dependencies: 'min'
130143
exclude:
131144
# Use ubuntu-latest to cover the whole range of Python. For Windows
132145
# and OSX, checking oldest and newest should be sufficient.
@@ -183,7 +196,7 @@ jobs:
183196
ARCH: ${{ !contains(fromJSON('["none", "min"]'), matrix.dependencies) && matrix.architecture }}
184197

185198
steps:
186-
- uses: actions/checkout@v4
199+
- uses: actions/checkout@v5
187200
with:
188201
submodules: recursive
189202
fetch-depth: 0
@@ -217,7 +230,9 @@ jobs:
217230
run: python -c "import sys; print(sys.version)"
218231
- name: Install tox
219232
run: |
220-
uv tool install -v tox --with=git+https://github.com/effigies/tox-gh-actions@abiflags --with=tox-uv
233+
uv tool install -v tox \
234+
--with=tox-uv \
235+
--with=git+https://github.com/effigies/tox-gh-actions@abiflags
221236
- name: Show tox config
222237
run: tox c
223238
- name: Run tox
@@ -242,7 +257,7 @@ jobs:
242257
check: ['style', 'doctest', 'typecheck', 'spellcheck']
243258

244259
steps:
245-
- uses: actions/checkout@v4
260+
- uses: actions/checkout@v5
246261
- name: Set up Python ${{ matrix.python-version }}
247262
uses: actions/setup-python@v5
248263
with:
@@ -265,7 +280,7 @@ jobs:
265280
id-token: write
266281
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
267282
steps:
268-
- uses: actions/download-artifact@v4
283+
- uses: actions/download-artifact@v5
269284
with:
270285
name: dist
271286
path: dist/

dev-requirements.txt

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

doc-requirements.txt

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

doc/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Nibabel documentation
55
To build the documentation, change to the root directory (containing
66
``pyproject.toml``) and run::
77

8-
pip install -r doc-requirements.txt
8+
uv sync --extra doc
9+
source .venv/bin/activate
910
make -C doc html

doc/source/devel/make_release.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ Release checklist
6868

6969
because this will be the output used by pypi_
7070

71-
* Check the dependencies listed in ``nibabel/info.py`` (e.g.
72-
``NUMPY_MIN_VERSION``) and in ``doc/source/installation.rst`` and in
73-
``requirements.txt`` and ``.travis.yml``. They should at least match. Do
74-
they still hold? Make sure `nibabel on travis`_ is testing the minimum
71+
* Check the dependencies listed in ``pyproject.toml`` and in
72+
``doc/source/installation.rst``. They should at least match. Do
73+
they still hold? Verify that `nibabel on GitHub actions`_ is testing the minimum
7574
dependencies specifically.
7675

7776
* Do a final check on the `nipy buildbot`_. Use the ``try_branch.py``
@@ -129,7 +128,7 @@ Release checklist
129128

130129
make -C doc doctest
131130

132-
This should also be tested by `nibabel on travis`_.
131+
This should also be tested by `nibabel on GitHub actions`_.
133132

134133
* Check everything compiles without syntax errors::
135134

doc/source/links_names.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
.. _nibabel issues: https://github.com/nipy/nibabel/issues
2121
.. _nibabel github issues: https://github.com/nipy/nibabel/issues
2222
.. _nibabel wiki: https://github.com/nipy/nibabel.wiki
23-
.. _nibabel on travis: https://travis-ci.org/nipy/nibabel
23+
.. _nibabel on github actions: https://github.com/nipy/nibabel/actions
2424

2525
.. other related projects
2626
.. _nipy community: http://nipy.org

min-requirements.txt

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

nibabel/cmdline/parrec2nii.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ def proc_file(infile, opts):
358358
)
359359
with open(basefilename + '.bvals', 'w') as fid:
360360
# np.savetxt could do this, but it's just a loop anyway
361-
for val in bvals:
362-
fid.write(f'{val} ')
361+
fid.writelines(f'{val} ' for val in bvals)
363362
fid.write('\n')
364363
else:
365364
verbose('Writing .bvals and .bvecs files')
@@ -369,13 +368,11 @@ def proc_file(infile, opts):
369368
bvecs = apply_affine(bv_reorient, bvecs)
370369
with open(basefilename + '.bvals', 'w') as fid:
371370
# np.savetxt could do this, but it's just a loop anyway
372-
for val in bvals:
373-
fid.write(f'{val} ')
371+
fid.writelines(f'{val} ' for val in bvals)
374372
fid.write('\n')
375373
with open(basefilename + '.bvecs', 'w') as fid:
376374
for row in bvecs.T:
377-
for val in row:
378-
fid.write(f'{val} ')
375+
fid.writelines(f'{val} ' for val in row)
379376
fid.write('\n')
380377

381378
# export data labels varying along the 4th dimensions if requested

nibabel/cmdline/tests/test_roi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
from nibabel.testing import data_path
1010

1111

12+
@pytest.fixture(scope='module', autouse=True)
13+
def NO_COLOR():
14+
with mock.patch.dict(os.environ, {'NO_COLOR': '1'}):
15+
yield
16+
17+
1218
def test_parse_slice():
1319
assert parse_slice(None) == slice(None)
1420
assert parse_slice('1:5') == slice(1, 5)

nibabel/openers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if ty.TYPE_CHECKING:
2222
from types import TracebackType
2323

24-
from _typeshed import WriteableBuffer
24+
from _typeshed import ReadableBuffer, WriteableBuffer
2525

2626
from ._typing import Self
2727

@@ -231,6 +231,9 @@ def readinto(self, buffer: WriteableBuffer, /) -> int | None:
231231
def write(self, b: bytes, /) -> int | None:
232232
return self.fobj.write(b)
233233

234+
def writelines(self, lines: ty.Iterable[ReadableBuffer], /) -> None:
235+
self.fobj.writelines(lines)
236+
234237
def seek(self, pos: int, whence: int = 0, /) -> int:
235238
return self.fobj.seek(pos, whence)
236239

0 commit comments

Comments
 (0)