Skip to content

Commit 7c69442

Browse files
authored
Merge pull request #787 from effigies/maint/purge_python2
MAINT: Require Python >= 3.5, purge Python 2 compatibility
2 parents 10ad38a + 6c66c6a commit 7c69442

File tree

118 files changed

+148
-602
lines changed

Some content is hidden

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

118 files changed

+148
-602
lines changed

.travis.yml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,59 @@ env:
2222
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
2323
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
2424
python:
25-
- 3.5
2625
- 3.6
2726
- 3.7
2827
matrix:
2928
include:
30-
- python: 3.4
31-
dist: trusty
32-
sudo: false
3329
# Absolute minimum dependencies
34-
- python: 2.7
30+
- python: 3.5
3531
env:
36-
- DEPENDS="numpy==1.8 setuptools==30.3.0"
32+
- DEPENDS="-r min-requirements.txt setuptools==30.3.0"
3733
# Absolute minimum dependencies
38-
- python: 2.7
34+
- python: 3.5
3935
env:
40-
- DEPENDS="numpy==1.8"
36+
- DEPENDS="-r min-requirements.txt"
4137
- CHECK_TYPE="import"
4238
# Absolute minimum dependencies plus oldest MPL
4339
# Check these against:
4440
# nibabel/info.py
4541
# doc/source/installation.rst
4642
# requirements.txt
47-
- python: 2.7
43+
- python: 3.5
4844
env:
49-
- DEPENDS="numpy==1.8 matplotlib==1.3.1"
45+
- DEPENDS="-r min-requirements.txt matplotlib==1.3.1"
5046
# Minimum pydicom dependency
51-
- python: 2.7
47+
- python: 3.5
5248
env:
53-
- DEPENDS="numpy==1.8 pydicom==0.9.9 pillow==2.6"
49+
- DEPENDS="-r min-requirements.txt pydicom==0.9.9 pillow==2.6"
5450
# pydicom master branch
5551
- python: 3.5
5652
env:
5753
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
58-
# test 2.7 against pre-release builds of everything
59-
- python: 2.7
60-
env:
61-
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
6254
# test 3.5 against pre-release builds of everything
6355
- python: 3.5
6456
env:
6557
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
66-
- python: 2.7
58+
- python: 3.5
6759
env:
6860
- INSTALL_TYPE=sdist
69-
- python: 2.7
61+
- python: 3.5
7062
env:
7163
- INSTALL_TYPE=wheel
72-
- python: 2.7
64+
- python: 3.5
7365
env:
7466
- INSTALL_TYPE=requirements
75-
- python: 2.7
67+
- python: 3.5
7668
env:
7769
- INSTALL_TYPE=archive
78-
- python: 2.7
79-
env:
80-
- CHECK_TYPE="style"
8170
- python: 3.5
8271
env:
8372
- CHECK_TYPE="style"
8473
# Documentation doctests
85-
- python: 2.7
86-
env:
87-
- CHECK_TYPE="doc_doctests"
8874
- python: 3.5
8975
env:
9076
- CHECK_TYPE="doc_doctests"
9177
# Run tests with indexed_gzip present
92-
- python: 2.7
93-
env:
94-
- OPTIONAL_DEPENDS="indexed_gzip"
9578
- python: 3.5
9679
env:
9780
- OPTIONAL_DEPENDS="indexed_gzip"

COPYING

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -218,34 +218,3 @@ the PDDL version 1.0 available at http://opendatacommons.org/licenses/pddl/1.0/
218218

219219
is courtesy of the University of Massachusetts Medical School, also released
220220
under the PDDL.
221-
222-
223-
Six
224-
--------------------
225-
226-
In ``nibabel/externals/six.py``
227-
228-
Copied from: https://pypi.python.org/packages/source/s/six/six-1.3.0.tar.gz#md5=ec47fe6070a8a64c802363d2c2b1e2ee
229-
230-
::
231-
232-
Copyright (c) 2010-2013 Benjamin Peterson
233-
234-
Permission is hereby granted, free of charge, to any person obtaining a copy of
235-
this software and associated documentation files (the "Software"), to deal in
236-
the Software without restriction, including without limitation the rights to
237-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
238-
the Software, and to permit persons to whom the Software is furnished to do so,
239-
subject to the following conditions:
240-
241-
The above copyright notice and this permission notice shall be included in all
242-
copies or substantial portions of the Software.
243-
244-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
245-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
246-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
247-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
248-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
249-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
250-
251-

doc/source/installation.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,10 @@ is for you.
8181
Requirements
8282
------------
8383

84-
.. check these against:
85-
nibabel/info.py
86-
requirements.txt
87-
.travis.yml
88-
89-
* Python_ 2.7, or >= 3.4
90-
* NumPy_ 1.8 or greater
91-
* Six_ 1.3 or greater
84+
.. check these against setup.cfg
85+
86+
* Python_ 3.5.1 or greater
87+
* NumPy_ 1.12 or greater
9288
* SciPy_ (optional, for full SPM-ANALYZE support)
9389
* PyDICOM_ 0.9.9 or greater (optional, for DICOM support)
9490
* `Python Imaging Library`_ (optional, for PNG conversion in DICOMFS)

doc/source/scripts/make_coord_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* someones_epi.nii.gz (pretend single EPI volume)
1616
* someones_anatomy.nii.gz (pretend single subject structural)
1717
"""
18-
from __future__ import division, print_function
1918

2019
import math
2120

doc/tools/build_modref_templates.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
"""Script to auto-generate our API docs.
33
"""
4-
from __future__ import print_function, division
54

65
# stdlib imports
76
import sys

min-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto-generated by tools/update_requirements.py
2+
numpy ==1.12

nibabel/affines.py

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

66
import numpy as np
77

8-
from six.moves import reduce
8+
from functools import reduce
99

1010

1111
class AffineError(ValueError):

nibabel/arraywriters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def __init__(self, array, out_dtype=None)
2828
something else to make sense of conversions between float and int, or between
2929
larger ints and smaller.
3030
"""
31-
from __future__ import division, absolute_import
3231

3332
import warnings
3433

nibabel/benchmarks/bench_array_to_file.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
1414
nosetests -s --match '(?:^|[\\b_\\.//-])[Bb]ench' /path/to/bench_load_save.py
1515
"""
16-
from __future__ import division, print_function
1716

1817
import sys
1918
from io import BytesIO # NOQA

nibabel/benchmarks/bench_fileslice.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
1212
nosetests -s --match '(?:^|[\\b_\\.//-])[Bb]ench' /path/to/bench_fileslice.py
1313
"""
14-
from __future__ import division, print_function
1514

1615
import sys
1716
from timeit import timeit

0 commit comments

Comments
 (0)