Skip to content

Commit 9fc2d34

Browse files
authored
Merge branch 'master' into np.sctypes
2 parents 363b403 + 79c8b4b commit 9fc2d34

38 files changed

+895
-545
lines changed

.github/workflows/misc.yml

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

.github/workflows/pre-release.yml

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

.github/workflows/stable.yml renamed to .github/workflows/test.yml

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stable tests
1+
name: Build and test
22

33
# This file tests the claimed support range of NiBabel including
44
#
@@ -35,7 +35,7 @@ jobs:
3535
build:
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939
with:
4040
fetch-depth: 0
4141
- uses: actions/setup-python@v4
@@ -94,70 +94,49 @@ jobs:
9494
if: matrix.package == 'archive'
9595
run: pip install archive/nibabel-archive.tgz
9696
- run: python -c 'import nibabel; print(nibabel.__version__)'
97-
- name: Install test extras
97+
- name: Install minimum test dependencies
9898
run: pip install nibabel[test]
9999
- name: Run tests
100-
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel
100+
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel -n auto
101101

102-
stable:
102+
test:
103103
# Check each OS, all supported Python, minimum versions and latest releases
104104
runs-on: ${{ matrix.os }}
105+
continue-on-error: ${{ matrix.dependencies == 'pre' }}
105106
strategy:
107+
fail-fast: false
106108
matrix:
107109
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
108-
python-version: [3.8, 3.9, "3.10", "3.11"]
110+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
109111
architecture: ['x64', 'x86']
110-
install: ['pip']
111-
check: ['test']
112-
pip-flags: ['']
113-
depends: ['REQUIREMENTS']
114-
optional-depends: ['DEFAULT_OPT_DEPENDS']
112+
dependencies: ['full', 'pre']
115113
include:
116114
# Basic dependencies only
117115
- os: ubuntu-latest
118116
python-version: 3.8
119-
install: pip
120-
check: test
121-
pip-flags: ''
122-
depends: REQUIREMENTS
123-
optional-depends: ''
117+
dependencies: 'none'
124118
# Absolute minimum dependencies
125119
- os: ubuntu-latest
126120
python-version: 3.8
127-
install: pip
128-
check: test
129-
pip-flags: ''
130-
depends: MIN_REQUIREMENTS
131-
optional-depends: ''
132-
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
121+
dependencies: 'min'
122+
# NumPy 2.0
133123
- os: ubuntu-latest
134-
python-version: 3.8
135-
install: pip
136-
check: test
137-
pip-flags: ''
138-
depends: MIN_REQUIREMENTS
139-
optional-depends: MIN_OPT_DEPENDS
140-
# Clean install imports only with package-declared dependencies
141-
- os: ubuntu-latest
142-
python-version: 3.8
143-
install: pip
144-
check: skiptests
145-
pip-flags: ''
146-
depends: ''
124+
python-version: '3.12'
125+
dependencies: 'dev'
147126
exclude:
148127
- os: ubuntu-latest
149128
architecture: x86
150129
- os: macos-latest
151130
architecture: x86
131+
- python-version: '3.12'
132+
architecture: x86
133+
152134
env:
153-
DEPENDS: ${{ matrix.depends }}
154-
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
155-
INSTALL_TYPE: ${{ matrix.install }}
156-
CHECK_TYPE: ${{ matrix.check }}
157-
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
135+
DEPENDS: ${{ matrix.dependencies }}
136+
ARCH: ${{ !contains(fromJSON('["none", "min"]'), matrix.dependencies) && matrix.architecture }}
158137

159138
steps:
160-
- uses: actions/checkout@v3
139+
- uses: actions/checkout@v4
161140
with:
162141
submodules: recursive
163142
fetch-depth: 0
@@ -166,36 +145,54 @@ jobs:
166145
with:
167146
python-version: ${{ matrix.python-version }}
168147
architecture: ${{ matrix.architecture }}
148+
allow-prereleases: true
169149
- name: Display Python version
170150
run: python -c "import sys; print(sys.version)"
171-
- name: Create virtual environment
172-
run: tools/ci/create_venv.sh
173-
- name: Build archive
151+
- name: Install tox
174152
run: |
175-
source tools/ci/build_archive.sh
176-
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
177-
- name: Install dependencies
178-
run: tools/ci/install_dependencies.sh
179-
- name: Install NiBabel
180-
run: tools/ci/install.sh
181-
- name: Run tests
182-
if: ${{ matrix.check != 'skiptests' }}
183-
run: tools/ci/check.sh
153+
python -m pip install --upgrade pip
154+
python -m pip install tox tox-gh-actions
155+
- name: Show tox config
156+
run: tox c
157+
- name: Run tox
158+
run: tox -v --exit-and-dump-after 1200
184159
- uses: codecov/codecov-action@v3
185160
if: ${{ always() }}
186161
with:
187162
files: cov.xml
188163
- name: Upload pytest test results
189-
if: ${{ always() && matrix.check == 'test' }}
190164
uses: actions/upload-artifact@v3
191165
with:
192166
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
193-
path: for_testing/test-results.xml
167+
path: test-results.xml
168+
if: ${{ always() }}
169+
170+
checks:
171+
runs-on: 'ubuntu-latest'
172+
continue-on-error: true
173+
strategy:
174+
matrix:
175+
check: ['style', 'doctest', 'typecheck']
176+
177+
steps:
178+
- uses: actions/checkout@v4
179+
- name: Set up Python ${{ matrix.python-version }}
180+
uses: actions/setup-python@v4
181+
with:
182+
python-version: 3
183+
- name: Display Python version
184+
run: python -c "import sys; print(sys.version)"
185+
- name: Show tox config
186+
run: pipx run tox c
187+
- name: Show tox config (this call)
188+
run: pipx run tox c -e ${{ matrix.check }}
189+
- name: Run check
190+
run: pipx run tox -e ${{ matrix.check }}
194191

195192
publish:
196193
runs-on: ubuntu-latest
197194
environment: "Package deployment"
198-
needs: [stable, test-package]
195+
needs: [test, test-package]
199196
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
200197
steps:
201198
- uses: actions/download-artifact@v3

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ dist/
4848
*.egg-info/
4949
.shelf
5050
.tox/
51-
.coverage
51+
.coverage*
52+
cov.xml
53+
test-results.xml
5254
.ropeproject/
5355
htmlcov/
5456
.*_cache/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: ".*/data/.*"
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.1.0
4+
rev: v4.4.0
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
@@ -21,12 +21,12 @@ repos:
2121
hooks:
2222
- id: isort
2323
- repo: https://github.com/pycqa/flake8
24-
rev: 6.0.0
24+
rev: 6.1.0
2525
hooks:
2626
- id: flake8
2727
exclude: "^(doc|nisext|tools)/"
2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v0.991
29+
rev: v1.5.1
3030
hooks:
3131
- id: mypy
3232
# Sync with project.optional-dependencies.typing

Changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ Special thanks to Chris Burns, Jarrod Millman and Yaroslav Halchenko.
12461246
* Very preliminary, limited and highly experimental DICOM reading support (MB,
12471247
Ian Nimmo Smith).
12481248
* Some functions (:py:mod:`nibabel.funcs`) for basic image shape changes, including
1249-
the ability to transform to the image with data closest to the cononical
1249+
the ability to transform to the image with data closest to the canonical
12501250
image orientation (first axis left-to-right, second back-to-front, third
12511251
down-to-up) (MB, Jonathan Taylor)
12521252
* Gifti format read and write support (preliminary) (Stephen Gerhard)

doc/source/devel/biaps/biap_0006.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ here is the definition of a "multi-frame image"::
202202
3.8.9 Multi-frame image:
203203
Image that contains multiple two-dimensional pixel planes.
204204

205-
From `PS 3.3 of the 2011 DICOM standrd
205+
From `PS 3.3 of the 2011 DICOM standard
206206
<http://medical.nema.org/Dicom/2011/11_03pu.pdf>`_.
207207

208208
**********************************

0 commit comments

Comments
 (0)