Skip to content

Commit 932a912

Browse files
authored
Merge pull request #92 from jakirkham/support_py37
Support Python 3.7
2 parents d645bdd + 8bbafba commit 932a912

File tree

11 files changed

+52
-39
lines changed

11 files changed

+52
-39
lines changed

.github/PULL_REQUEST_TEMPLATE.md

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

33
TODO:
44
* [ ] Unit tests and/or doctests in docstrings
5-
* [ ] ``tox -e py36`` passes locally
5+
* [ ] ``tox -e py37`` passes locally
66
* [ ] ``tox -e py27`` passes locally
77
* [ ] Docstrings and API docs for any new/modified user-facing classes and functions
88
* [ ] Changes documented in docs/release.rst

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ addons:
1111
packages:
1212
- liblzma-dev
1313

14-
python:
15-
- 2.7
16-
- 3.5
17-
- 3.6
14+
matrix:
15+
include:
16+
- python: 2.7
17+
- python: 3.5
18+
- python: 3.6
19+
- python: 3.7
20+
dist: xenial
21+
sudo: true
1822

1923
install:
2024
- pip install -U tox-travis coveralls pip setuptools wheel

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ environment:
3131
- PYTHON: "C:\\Python36-x64"
3232
PYTHON_VERSION: "3.6"
3333

34+
- PYTHON: "C:\\Python37"
35+
PYTHON_VERSION: "3.7"
36+
37+
- PYTHON: "C:\\Python37-x64"
38+
PYTHON_VERSION: "3.7"
39+
3440
install:
3541
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
3642
- git submodule update --init --recursive

docs/contributing.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ you have cloned the NumCodecs source code and your current working directory is
9090
the repository, you can do something like the following::
9191

9292
$ mkdir -p ~/pyenv/numcodecs-dev
93-
$ virtualenv --no-site-packages --python=/usr/bin/python3.6 ~/pyenv/numcodecs-dev
93+
$ virtualenv --no-site-packages --python=/usr/bin/python3.7 ~/pyenv/numcodecs-dev
9494
$ source ~/pyenv/numcodecs-dev/bin/activate
9595
$ pip install -r requirements_dev.txt
9696
$ python setup.py build_ext --inplace
@@ -145,11 +145,11 @@ To also run the doctests within docstrings, run::
145145
Tests can be run under different Python versions using tox. E.g. (assuming you have the
146146
corresponding Python interpreters installed on your system)::
147147

148-
$ tox -e py27,py35,py36
148+
$ tox -e py27,py35,py36,py37
149149

150-
NumCodecs currently supports Python 2.7 and Python 3.5-3.6, so the above command must
151-
succeed before code can be accepted into the main code base. Note that only the py36
152-
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.6.
150+
NumCodecs currently supports Python 2.7 and Python 3.5-3.7, so the above command must
151+
succeed before code can be accepted into the main code base. Note that only the py37
152+
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.7.
153153

154154
All tests are automatically run via Travis (Linux) and AppVeyor (Windows) continuous
155155
integration services for every pull request. Tests must pass under both services before
@@ -164,14 +164,14 @@ Conformance can be checked by running::
164164

165165
$ flake8 --max-line-length=100 numcodecs
166166

167-
This is automatically run when invoking ``tox -e py36``.
167+
This is automatically run when invoking ``tox -e py37``.
168168

169169
Test coverage
170170
~~~~~~~~~~~~~
171171

172172
NumCodecs maintains 100% test coverage under the latest Python stable release (currently
173-
Python 3.6). Both unit tests and docstring doctests are included when computing
174-
coverage. Running ``tox -e py36`` will automatically run the test suite with coverage
173+
Python 3.7). Both unit tests and docstring doctests are included when computing
174+
coverage. Running ``tox -e py37`` will automatically run the test suite with coverage
175175
and produce a coverage report. This should be 100% before code can be accepted into the
176176
main code base.
177177

@@ -185,7 +185,7 @@ Documentation
185185
Docstrings for user-facing classes and functions should follow the `numpydoc
186186
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_ standard,
187187
including sections for Parameters and Examples. All examples will be run as doctests
188-
under Python 3.6.
188+
under Python 3.7.
189189

190190
NumCodecs uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
191191
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.

docs/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Release notes
2323

2424
* Drop Python 3.4 (by :user:`John Kirkham <jakirkham>`; :issue:`89`).
2525

26+
* Add Python 3.7 (by :user:`John Kirkham <jakirkham>`; :issue:`92`).
27+
2628

2729
.. _release_0.5.5:
2830

numcodecs/fixedscaleoffset.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,33 @@ class FixedScaleOffset(Codec):
3838
>>> import numpy as np
3939
>>> x = np.linspace(1000, 1001, 10, dtype='f8')
4040
>>> x
41-
array([ 1000. , 1000.11111111, 1000.22222222, 1000.33333333,
42-
1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778,
43-
1000.88888889, 1001. ])
41+
array([1000. , 1000.11111111, 1000.22222222, 1000.33333333,
42+
1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778,
43+
1000.88888889, 1001. ])
4444
>>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10, dtype='f8', astype='u1')
4545
>>> y1 = codec.encode(x)
4646
>>> y1
4747
array([ 0, 1, 2, 3, 4, 6, 7, 8, 9, 10], dtype=uint8)
4848
>>> z1 = codec.decode(y1)
4949
>>> z1
50-
array([ 1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7,
51-
1000.8, 1000.9, 1001. ])
50+
array([1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7,
51+
1000.8, 1000.9, 1001. ])
5252
>>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**2, dtype='f8', astype='u1')
5353
>>> y2 = codec.encode(x)
5454
>>> y2
55-
array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8)
55+
array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8)
5656
>>> z2 = codec.decode(y2)
5757
>>> z2
58-
array([ 1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56,
59-
1000.67, 1000.78, 1000.89, 1001. ])
58+
array([1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56,
59+
1000.67, 1000.78, 1000.89, 1001. ])
6060
>>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**3, dtype='f8', astype='u2')
6161
>>> y3 = codec.encode(x)
6262
>>> y3
63-
array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16)
63+
array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16)
6464
>>> z3 = codec.decode(y3)
6565
>>> z3
66-
array([ 1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556,
67-
1000.667, 1000.778, 1000.889, 1001. ])
66+
array([1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556,
67+
1000.667, 1000.778, 1000.889, 1001. ])
6868
6969
See Also
7070
--------

numcodecs/packbits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PackBits(Codec):
2323
array([ 4, 144], dtype=uint8)
2424
>>> z = codec.decode(y)
2525
>>> z
26-
array([ True, False, False, True], dtype=bool)
26+
array([ True, False, False, True])
2727
2828
Notes
2929
-----

numcodecs/quantize.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ class Quantize(Codec):
2828
>>> import numpy as np
2929
>>> x = np.linspace(0, 1, 10, dtype='f8')
3030
>>> x
31-
array([ 0. , 0.11111111, 0.22222222, 0.33333333, 0.44444444,
32-
0.55555556, 0.66666667, 0.77777778, 0.88888889, 1. ])
31+
array([0. , 0.11111111, 0.22222222, 0.33333333, 0.44444444,
32+
0.55555556, 0.66666667, 0.77777778, 0.88888889, 1. ])
3333
>>> codec = numcodecs.Quantize(digits=1, dtype='f8')
3434
>>> codec.encode(x)
35-
array([ 0. , 0.125 , 0.25 , 0.3125, 0.4375, 0.5625, 0.6875,
36-
0.75 , 0.875 , 1. ])
35+
array([0. , 0.125 , 0.25 , 0.3125, 0.4375, 0.5625, 0.6875,
36+
0.75 , 0.875 , 1. ])
3737
>>> codec = numcodecs.Quantize(digits=2, dtype='f8')
3838
>>> codec.encode(x)
39-
array([ 0. , 0.109375 , 0.21875 , 0.3359375, 0.4453125,
40-
0.5546875, 0.6640625, 0.78125 , 0.890625 , 1. ])
39+
array([0. , 0.109375 , 0.21875 , 0.3359375, 0.4453125,
40+
0.5546875, 0.6640625, 0.78125 , 0.890625 , 1. ])
4141
>>> codec = numcodecs.Quantize(digits=3, dtype='f8')
4242
>>> codec.encode(x)
43-
array([ 0. , 0.11132812, 0.22265625, 0.33300781, 0.44433594,
44-
0.55566406, 0.66699219, 0.77734375, 0.88867188, 1. ])
43+
array([0. , 0.11132812, 0.22265625, 0.33300781, 0.44433594,
44+
0.55566406, 0.66699219, 0.77734375, 0.88867188, 1. ])
4545
4646
See Also
4747
--------

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ idna==2.6
1313
mccabe==0.6.1
1414
monotonic==1.3
1515
msgpack==0.5.6
16-
numpy==1.13.3
16+
numpy==1.15.3
1717
packaging==16.8
1818
pkginfo==1.4.1
1919
pluggy==0.5.2

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ def run_setup(with_extensions):
341341
'Programming Language :: Python :: 3',
342342
'Programming Language :: Python :: 3.5',
343343
'Programming Language :: Python :: 3.6',
344+
'Programming Language :: Python :: 3.7',
344345
],
345346
author='Alistair Miles',
346347
author_email='[email protected]',

0 commit comments

Comments
 (0)