Skip to content

Commit c3c3e04

Browse files
authored
Merge branch 'master' into master
2 parents 97107b7 + b7022e0 commit c3c3e04

File tree

309 files changed

+12710
-14253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+12710
-14253
lines changed

.flake8

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[flake8]
2+
max-line-length = 100
3+
extend-ignore = E203,E266,E402,E731
4+
exclude =
5+
*test*
6+
*sphinx*
7+
nibabel/externals/*
8+
per-file-ignores =
9+
*/__init__.py: F401

.git-blame-ignore-revs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Sun Jan 1 12:38:02 2023 -0500 - [email protected] - STY: Run pre-commit config on all files
2+
d14c1cf282a9c3b19189f490f10c35f5739e24d1
3+
# Thu Dec 29 22:53:17 2022 -0500 - [email protected] - STY: Reduce array().astype() and similar constructs
4+
bf298113da99079c9c7b5e1690e41879828cd472
5+
# Thu Dec 29 22:32:46 2022 -0500 - [email protected] - STY: pyupgrade --py37-plus
6+
4481a4c2640bd4be6e9c468e550d01aae448ab99
7+
# Fri Dec 30 11:01:19 2022 -0500 - [email protected] - STY: Run vanilla blue
8+
6b0ddd23b1da1df7ca9ae275673f82bfa20a754c
9+
# Thu Dec 29 21:46:13 2022 -0500 - [email protected] - STY: Manual, blue-compatible touchups
10+
263fca9bf6d4ca314a5a322b4824d6f53d0589df
11+
# Thu Dec 29 21:32:00 2022 -0500 - [email protected] - STY: isort
12+
0ab2856cac4d4baae7ab3e2f6d58421db55d807f
13+
# Thu Dec 29 21:30:29 2022 -0500 - [email protected] - STY: blue
14+
1a8dd302ff85b1136c81d492509b80e7748339f0

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:match=[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
nibabel/_version.py export-subst
1+
.git_archival.txt export-subst
2+
nibabel/pkg_info.py export-subst

.github/workflows/misc.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
python-version: ["3.10"]
2626
install: ['pip']
27-
check: ['style', 'doc']
27+
check: ['style', 'doctest', 'typing']
2828
pip-flags: ['']
2929
depends: ['REQUIREMENTS']
3030
env:
@@ -59,9 +59,6 @@ jobs:
5959
- name: Run tests
6060
run: tools/ci/check.sh
6161
if: ${{ matrix.check != 'skiptests' }}
62-
- name: Submit coverage
63-
run: tools/ci/submit_coverage.sh
64-
if: ${{ always() }}
6562
- name: Upload pytest test results
6663
uses: actions/upload-artifact@v3
6764
with:

.github/workflows/pre-release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ defaults:
1818
run:
1919
shell: bash
2020

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
permissions:
26+
contents: read
27+
2128
jobs:
2229
pre-release:
2330
# Check pre-releases of dependencies on stable Python
@@ -26,7 +33,7 @@ jobs:
2633
strategy:
2734
matrix:
2835
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
29-
python-version: ["3.9", "3.10"]
36+
python-version: ["3.9", "3.10", "3.11"]
3037
architecture: ['x64', 'x86']
3138
install: ['pip']
3239
check: ['test']
@@ -36,7 +43,7 @@ jobs:
3643
include:
3744
# Pydicom master
3845
- os: ubuntu-latest
39-
python-version: "3.10"
46+
python-version: "3.11"
4047
install: pip
4148
check: test
4249
pip-flags: ''
@@ -80,9 +87,10 @@ jobs:
8087
- name: Run tests
8188
run: tools/ci/check.sh
8289
if: ${{ matrix.check != 'skiptests' }}
83-
- name: Submit coverage
84-
run: tools/ci/submit_coverage.sh
90+
- uses: codecov/codecov-action@v3
8591
if: ${{ always() }}
92+
with:
93+
files: cov.xml
8694
- name: Upload pytest test results
8795
uses: actions/upload-artifact@v3
8896
with:

.github/workflows/stable.yml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ defaults:
2424
run:
2525
shell: bash
2626

27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
permissions:
32+
contents: read
33+
2734
jobs:
2835
build:
2936
runs-on: ubuntu-latest
@@ -39,11 +46,17 @@ jobs:
3946
run: python -m build
4047
- run: twine check dist/*
4148
- name: Build git archive
42-
run: git archive -v -o dist/nibabel-archive.tgz HEAD
43-
- uses: actions/upload-artifact@v3
49+
run: mkdir archive && git archive -v -o archive/nibabel-archive.tgz HEAD
50+
- name: Upload sdist and wheel artifacts
51+
uses: actions/upload-artifact@v3
4452
with:
4553
name: dist
4654
path: dist/
55+
- name: Upload git archive artifact
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: archive
59+
path: archive/
4760

4861
test-package:
4962
runs-on: ubuntu-latest
@@ -52,10 +65,18 @@ jobs:
5265
matrix:
5366
package: ['wheel', 'sdist', 'archive']
5467
steps:
55-
- uses: actions/download-artifact@v3
68+
- name: Download sdist and wheel artifacts
69+
if: matrix.package != 'archive'
70+
uses: actions/download-artifact@v3
5671
with:
5772
name: dist
5873
path: dist/
74+
- name: Download git archive artifact
75+
if: matrix.package == 'archive'
76+
uses: actions/download-artifact@v3
77+
with:
78+
name: archive
79+
path: archive/
5980
- uses: actions/setup-python@v4
6081
with:
6182
python-version: 3
@@ -64,14 +85,14 @@ jobs:
6485
- name: Update pip
6586
run: pip install --upgrade pip
6687
- name: Install wheel
67-
run: pip install dist/nibabel-*.whl
6888
if: matrix.package == 'wheel'
89+
run: pip install dist/nibabel-*.whl
6990
- name: Install sdist
70-
run: pip install dist/nibabel-*.tar.gz
7191
if: matrix.package == 'sdist'
92+
run: pip install dist/nibabel-*.tar.gz
7293
- name: Install archive
73-
run: pip install dist/nibabel-archive.tgz
7494
if: matrix.package == 'archive'
95+
run: pip install archive/nibabel-archive.tgz
7596
- run: python -c 'import nibabel; print(nibabel.__version__)'
7697
- name: Install test extras
7798
run: pip install nibabel[test]
@@ -84,7 +105,7 @@ jobs:
84105
strategy:
85106
matrix:
86107
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
87-
python-version: [3.7, 3.8, 3.9, "3.10"]
108+
python-version: [3.8, 3.9, "3.10", "3.11"]
88109
architecture: ['x64', 'x86']
89110
install: ['pip']
90111
check: ['test']
@@ -94,31 +115,31 @@ jobs:
94115
include:
95116
# Basic dependencies only
96117
- os: ubuntu-latest
97-
python-version: 3.7
118+
python-version: 3.8
98119
install: pip
99120
check: test
100121
pip-flags: ''
101122
depends: REQUIREMENTS
102123
optional-depends: ''
103124
# Absolute minimum dependencies
104125
- os: ubuntu-latest
105-
python-version: 3.7
126+
python-version: 3.8
106127
install: pip
107128
check: test
108129
pip-flags: ''
109130
depends: MIN_REQUIREMENTS
110131
optional-depends: ''
111132
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
112133
- os: ubuntu-latest
113-
python-version: 3.7
134+
python-version: 3.8
114135
install: pip
115136
check: test
116137
pip-flags: ''
117138
depends: MIN_REQUIREMENTS
118139
optional-depends: MIN_OPT_DEPENDS
119140
# Clean install imports only with package-declared dependencies
120141
- os: ubuntu-latest
121-
python-version: 3.7
142+
python-version: 3.8
122143
install: pip
123144
check: skiptests
124145
pip-flags: ''
@@ -158,17 +179,18 @@ jobs:
158179
- name: Install NiBabel
159180
run: tools/ci/install.sh
160181
- name: Run tests
161-
run: tools/ci/check.sh
162182
if: ${{ matrix.check != 'skiptests' }}
163-
- name: Submit coverage
164-
run: tools/ci/submit_coverage.sh
183+
run: tools/ci/check.sh
184+
- uses: codecov/codecov-action@v3
165185
if: ${{ always() }}
186+
with:
187+
files: cov.xml
166188
- name: Upload pytest test results
189+
if: ${{ always() && matrix.check == 'test' }}
167190
uses: actions/upload-artifact@v3
168191
with:
169192
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
170193
path: for_testing/test-results.xml
171-
if: ${{ always() && matrix.check == 'test' }}
172194

173195
publish:
174196
runs-on: ubuntu-latest

.gitignore

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# See also nibabel/.gitignore for test data rules that
2+
# are meant to make you think before you `git add --force`
3+
14
# Editor temporary/working/backup files #
25
#########################################
36
.#*
@@ -36,23 +39,6 @@
3639
*.py[oc]
3740
*.so
3841

39-
# Packages #
40-
############
41-
# it's better to unpack these files and commit the raw source
42-
# git has its own built in compression methods
43-
*.7z
44-
*.bz2
45-
*.bzip2
46-
*.dmg
47-
*.gz
48-
*.iso
49-
*.jar
50-
*.rar
51-
*.tar
52-
*.tbz2
53-
*.tgz
54-
*.zip
55-
5642
# Python files #
5743
################
5844
build/
@@ -65,12 +51,14 @@ dist/
6551
.coverage
6652
.ropeproject/
6753
htmlcov/
54+
.*_cache/
6855

6956
# Logs and databases #
7057
######################
7158
*.log
7259
*.sql
7360
*.sqlite
61+
*.sqlite3
7462

7563
# OS generated files #
7664
######################
@@ -83,7 +71,12 @@ Thumbs.db
8371
# Things specific to this project #
8472
###################################
8573
doc/source/reference
74+
doc/source/generated
8675
venv/
8776
.buildbot.patch
8877
.vscode
8978
for_testing/
79+
80+
# Generated by setuptools_scm #
81+
###############################
82+
_version.py

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Dimitri Papadopoulos Orfanos <[email protected]> <DimitriPapadopoulos@
3030
Dimitri Papadopoulos Orfanos <[email protected]> <[email protected]>
3131
Eric Larson <[email protected]> Eric89GXL <[email protected]>
3232
Eric Larson <[email protected]> larsoner <[email protected]>
33+
Fabian Perez <[email protected]>
3334
Fernando Pérez-García <[email protected]> Fernando <[email protected]>
3435
Félix C. Morency <[email protected]> Felix C. Morency <[email protected]>
3536
Félix C. Morency <[email protected]> Félix C. Morency <[email protected]>

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
exclude: ".*/data/.*"
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.1.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-json
10+
- id: check-toml
11+
- id: check-added-large-files
12+
- id: check-case-conflict
13+
- id: check-merge-conflict
14+
- id: check-vcs-permalinks
15+
- repo: https://github.com/grantjenks/blue
16+
rev: v0.9.1
17+
hooks:
18+
- id: blue
19+
- repo: https://github.com/pycqa/isort
20+
rev: 5.12.0
21+
hooks:
22+
- id: isort
23+
- repo: https://github.com/pycqa/flake8
24+
rev: 6.0.0
25+
hooks:
26+
- id: flake8
27+
exclude: "^(doc|nisext|tools)/"
28+
- repo: https://github.com/pre-commit/mirrors-mypy
29+
rev: v0.991
30+
hooks:
31+
- id: mypy
32+
# Sync with project.optional-dependencies.typing
33+
additional_dependencies:
34+
- pytest
35+
- types-setuptools
36+
- types-Pillow
37+
- pydicom
38+
- numpy
39+
- pyzstd
40+
- importlib_resources
41+
args: ["nibabel"]
42+
pass_filenames: false

0 commit comments

Comments
 (0)