Skip to content

Commit 2937a3a

Browse files
authored
Merge pull request #1079 from effigies/mnt/nep29
NEP29: Require Python 3.7+, numpy 1.17+, declare 3.10 support
2 parents 4ecf756 + d90e8a0 commit 2937a3a

16 files changed

+34
-99
lines changed

.github/workflows/pre-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
29-
python-version: ["3.8", "3.9", "3.10.0-rc.1"]
29+
python-version: ["3.9", "3.10"]
3030
architecture: ['x64', 'x86']
3131
install: ['setup']
3232
check: ['test']
@@ -36,7 +36,7 @@ jobs:
3636
include:
3737
# Pydicom master
3838
- os: ubuntu-latest
39-
python-version: 3.8
39+
python-version: "3.10"
4040
install: setup
4141
check: test
4242
pip-flags: ''
@@ -47,10 +47,6 @@ jobs:
4747
architecture: x86
4848
- os: macos-latest
4949
architecture: x86
50-
- os: windows-latest
51-
python-version: "3.10.0-rc.1"
52-
- os: macos-latest
53-
python-version: "3.10.0-rc.1"
5450

5551
env:
5652
DEPENDS: ${{ matrix.depends }}

.github/workflows/stable.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
32-
python-version: [3.6, 3.7, 3.8, 3.9]
32+
python-version: [3.7, 3.8, 3.9, "3.10"]
3333
architecture: ['x64', 'x86']
3434
install: ['pip']
3535
check: ['test']
@@ -39,52 +39,52 @@ jobs:
3939
include:
4040
# Basic dependencies only
4141
- os: ubuntu-latest
42-
python-version: 3.6
42+
python-version: 3.7
4343
install: setup
4444
check: test
4545
pip-flags: ''
4646
depends: REQUIREMENTS
4747
optional-depends: ''
4848
# Absolute minimum dependencies
4949
- os: ubuntu-latest
50-
python-version: 3.6
50+
python-version: 3.7
5151
install: setup
5252
check: test
5353
pip-flags: ''
5454
depends: MIN_REQUIREMENTS
5555
optional-depends: ''
5656
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
5757
- os: ubuntu-latest
58-
python-version: 3.6
58+
python-version: 3.7
5959
install: setup
6060
check: test
6161
pip-flags: ''
6262
depends: MIN_REQUIREMENTS
6363
optional-depends: MIN_OPT_DEPENDS
6464
# Clean install imports only with package-declared dependencies
6565
- os: ubuntu-latest
66-
python-version: 3.6
66+
python-version: 3.7
6767
install: pip
6868
check: skiptests
6969
pip-flags: ''
7070
depends: ''
7171
# Check all installation methods
7272
- os: ubuntu-latest
73-
python-version: 3.8
73+
python-version: "3.10"
7474
install: wheel
7575
check: test
7676
pip-flags: ''
7777
depends: REQUIREMENTS
7878
optional-depends: DEFAULT_OPT_DEPENDS
7979
- os: ubuntu-latest
80-
python-version: 3.8
80+
python-version: "3.10"
8181
install: sdist
8282
check: test
8383
pip-flags: ''
8484
depends: REQUIREMENTS
8585
optional-depends: DEFAULT_OPT_DEPENDS
8686
- os: ubuntu-latest
87-
python-version: 3.8
87+
python-version: "3.10"
8888
install: archive
8989
check: test
9090
pip-flags: ''

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
os: linux
88
arch: arm64
9-
dist: xenial
9+
dist: focal
1010
language: python
1111
cache: pip
1212

@@ -21,10 +21,10 @@ env:
2121
- CHECK_TYPE="test"
2222

2323
python:
24-
- 3.6
2524
- 3.7
2625
- 3.8
2726
- 3.9
27+
- "3.10"
2828

2929
# Set up virtual environment, build package, build from depends
3030
before_install:

min-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Auto-generated by tools/update_requirements.py
2-
numpy ==1.15
2+
numpy ==1.17
33
packaging ==17.0
44
setuptools

nibabel/_h5py_compat.py

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

nibabel/minc2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class Minc2Image(Minc1Image):
158158
def from_file_map(klass, file_map, *, mmap=True, keep_file_open=None):
159159
# Import of h5py might take awhile for MPI-enabled builds
160160
# So we are importing it here "on demand"
161-
from ._h5py_compat import h5py
161+
import h5py
162162
holder = file_map['image']
163163
if holder.filename is None:
164164
raise MincError('MINC2 needs filename for load')

nibabel/testing/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@
2424

2525
from itertools import zip_longest
2626

27-
try:
28-
from contextlib import nullcontext
29-
except ImportError: # PY36
30-
from contextlib import contextmanager
31-
@contextmanager
32-
def nullcontext():
33-
yield
27+
from contextlib import nullcontext
3428

3529

3630
def test_data(subdir=None, fname=None):

nibabel/tests/test_h5py_compat.py

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

nibabel/tests/test_image_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from ..optpkg import optional_package
3434
_, have_scipy, _ = optional_package('scipy')
35-
from .._h5py_compat import have_h5py
35+
_, have_h5py, _ = optional_package('h5py')
3636

3737
from .. import (AnalyzeImage, Spm99AnalyzeImage, Spm2AnalyzeImage,
3838
Nifti1Pair, Nifti1Image, Nifti2Pair, Nifti2Image,

nibabel/tests/test_imageclasses.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from nibabel.analyze import AnalyzeImage
1111
from nibabel.nifti1 import Nifti1Image
1212
from nibabel.nifti2 import Nifti2Image
13-
from .._h5py_compat import have_h5py
1413

1514
from nibabel import imageclasses
1615
from nibabel.imageclasses import spatial_axes_first, class_map, ext_map
1716

18-
17+
from nibabel.optpkg import optional_package
1918
from nibabel.testing import clear_and_catch_warnings
2019

2120

21+
have_h5py = optional_package('h5py')[1]
22+
2223
DATA_DIR = pjoin(dirname(__file__), 'data')
2324

2425
MINC_3DS = ('minc1_1_scale.mnc',)

0 commit comments

Comments
 (0)