diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cc3265ca..3b36ca01 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,7 @@ TODO: * [ ] Unit tests and/or doctests in docstrings -* [ ] ``tox -e py36`` passes locally +* [ ] ``tox -e py37`` passes locally * [ ] ``tox -e py27`` passes locally * [ ] Docstrings and API docs for any new/modified user-facing classes and functions * [ ] Changes documented in docs/release.rst diff --git a/.travis.yml b/.travis.yml index 1afe9443..54865cff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,14 @@ addons: packages: - liblzma-dev -python: - - 2.7 - - 3.5 - - 3.6 +matrix: + include: + - python: 2.7 + - python: 3.5 + - python: 3.6 + - python: 3.7 + dist: xenial + sudo: true install: - pip install -U tox-travis coveralls pip setuptools wheel diff --git a/appveyor.yml b/appveyor.yml index 13b7e196..96c8ebc2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,12 @@ environment: - PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6" + - PYTHON: "C:\\Python37" + PYTHON_VERSION: "3.7" + + - PYTHON: "C:\\Python37-x64" + PYTHON_VERSION: "3.7" + install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - git submodule update --init --recursive diff --git a/docs/contributing.rst b/docs/contributing.rst index a95c18c0..2673b3fe 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -90,7 +90,7 @@ you have cloned the NumCodecs source code and your current working directory is the repository, you can do something like the following:: $ mkdir -p ~/pyenv/numcodecs-dev - $ virtualenv --no-site-packages --python=/usr/bin/python3.6 ~/pyenv/numcodecs-dev + $ virtualenv --no-site-packages --python=/usr/bin/python3.7 ~/pyenv/numcodecs-dev $ source ~/pyenv/numcodecs-dev/bin/activate $ pip install -r requirements_dev.txt $ python setup.py build_ext --inplace @@ -145,11 +145,11 @@ To also run the doctests within docstrings, run:: Tests can be run under different Python versions using tox. E.g. (assuming you have the corresponding Python interpreters installed on your system):: - $ tox -e py27,py35,py36 + $ tox -e py27,py35,py36,py37 -NumCodecs currently supports Python 2.7 and Python 3.5-3.6, so the above command must -succeed before code can be accepted into the main code base. Note that only the py36 -tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.6. +NumCodecs currently supports Python 2.7 and Python 3.5-3.7, so the above command must +succeed before code can be accepted into the main code base. Note that only the py37 +tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.7. All tests are automatically run via Travis (Linux) and AppVeyor (Windows) continuous integration services for every pull request. Tests must pass under both services before @@ -164,14 +164,14 @@ Conformance can be checked by running:: $ flake8 --max-line-length=100 numcodecs -This is automatically run when invoking ``tox -e py36``. +This is automatically run when invoking ``tox -e py37``. Test coverage ~~~~~~~~~~~~~ NumCodecs maintains 100% test coverage under the latest Python stable release (currently -Python 3.6). Both unit tests and docstring doctests are included when computing -coverage. Running ``tox -e py36`` will automatically run the test suite with coverage +Python 3.7). Both unit tests and docstring doctests are included when computing +coverage. Running ``tox -e py37`` will automatically run the test suite with coverage and produce a coverage report. This should be 100% before code can be accepted into the main code base. @@ -185,7 +185,7 @@ Documentation Docstrings for user-facing classes and functions should follow the `numpydoc `_ standard, including sections for Parameters and Examples. All examples will be run as doctests -under Python 3.6. +under Python 3.7. NumCodecs uses Sphinx for documentation, hosted on readthedocs.org. Documentation is written in the RestructuredText markup language (.rst files) in the ``docs`` folder. diff --git a/docs/release.rst b/docs/release.rst index 7a0ba17f..71a6c243 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -23,6 +23,8 @@ Release notes * Drop Python 3.4 (by :user:`John Kirkham `; :issue:`89`). +* Add Python 3.7 (by :user:`John Kirkham `; :issue:`92`). + .. _release_0.5.5: diff --git a/numcodecs/fixedscaleoffset.py b/numcodecs/fixedscaleoffset.py index ecdc953f..a5f86aca 100644 --- a/numcodecs/fixedscaleoffset.py +++ b/numcodecs/fixedscaleoffset.py @@ -38,33 +38,33 @@ class FixedScaleOffset(Codec): >>> import numpy as np >>> x = np.linspace(1000, 1001, 10, dtype='f8') >>> x - array([ 1000. , 1000.11111111, 1000.22222222, 1000.33333333, - 1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778, - 1000.88888889, 1001. ]) + array([1000. , 1000.11111111, 1000.22222222, 1000.33333333, + 1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778, + 1000.88888889, 1001. ]) >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10, dtype='f8', astype='u1') >>> y1 = codec.encode(x) >>> y1 array([ 0, 1, 2, 3, 4, 6, 7, 8, 9, 10], dtype=uint8) >>> z1 = codec.decode(y1) >>> z1 - array([ 1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7, - 1000.8, 1000.9, 1001. ]) + array([1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7, + 1000.8, 1000.9, 1001. ]) >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**2, dtype='f8', astype='u1') >>> y2 = codec.encode(x) >>> y2 - array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8) + array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8) >>> z2 = codec.decode(y2) >>> z2 - array([ 1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56, - 1000.67, 1000.78, 1000.89, 1001. ]) + array([1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56, + 1000.67, 1000.78, 1000.89, 1001. ]) >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**3, dtype='f8', astype='u2') >>> y3 = codec.encode(x) >>> y3 - array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16) + array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16) >>> z3 = codec.decode(y3) >>> z3 - array([ 1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556, - 1000.667, 1000.778, 1000.889, 1001. ]) + array([1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556, + 1000.667, 1000.778, 1000.889, 1001. ]) See Also -------- diff --git a/numcodecs/packbits.py b/numcodecs/packbits.py index df799e8c..2161dd2a 100644 --- a/numcodecs/packbits.py +++ b/numcodecs/packbits.py @@ -23,7 +23,7 @@ class PackBits(Codec): array([ 4, 144], dtype=uint8) >>> z = codec.decode(y) >>> z - array([ True, False, False, True], dtype=bool) + array([ True, False, False, True]) Notes ----- diff --git a/numcodecs/quantize.py b/numcodecs/quantize.py index cbd541ad..b1e2565b 100644 --- a/numcodecs/quantize.py +++ b/numcodecs/quantize.py @@ -28,20 +28,20 @@ class Quantize(Codec): >>> import numpy as np >>> x = np.linspace(0, 1, 10, dtype='f8') >>> x - array([ 0. , 0.11111111, 0.22222222, 0.33333333, 0.44444444, - 0.55555556, 0.66666667, 0.77777778, 0.88888889, 1. ]) + array([0. , 0.11111111, 0.22222222, 0.33333333, 0.44444444, + 0.55555556, 0.66666667, 0.77777778, 0.88888889, 1. ]) >>> codec = numcodecs.Quantize(digits=1, dtype='f8') >>> codec.encode(x) - array([ 0. , 0.125 , 0.25 , 0.3125, 0.4375, 0.5625, 0.6875, - 0.75 , 0.875 , 1. ]) + array([0. , 0.125 , 0.25 , 0.3125, 0.4375, 0.5625, 0.6875, + 0.75 , 0.875 , 1. ]) >>> codec = numcodecs.Quantize(digits=2, dtype='f8') >>> codec.encode(x) - array([ 0. , 0.109375 , 0.21875 , 0.3359375, 0.4453125, - 0.5546875, 0.6640625, 0.78125 , 0.890625 , 1. ]) + array([0. , 0.109375 , 0.21875 , 0.3359375, 0.4453125, + 0.5546875, 0.6640625, 0.78125 , 0.890625 , 1. ]) >>> codec = numcodecs.Quantize(digits=3, dtype='f8') >>> codec.encode(x) - array([ 0. , 0.11132812, 0.22265625, 0.33300781, 0.44433594, - 0.55566406, 0.66699219, 0.77734375, 0.88867188, 1. ]) + array([0. , 0.11132812, 0.22265625, 0.33300781, 0.44433594, + 0.55566406, 0.66699219, 0.77734375, 0.88867188, 1. ]) See Also -------- diff --git a/requirements_dev.txt b/requirements_dev.txt index f70190ac..32c2cda3 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -13,7 +13,7 @@ idna==2.6 mccabe==0.6.1 monotonic==1.3 msgpack==0.5.6 -numpy==1.13.3 +numpy==1.15.3 packaging==16.8 pkginfo==1.4.1 pluggy==0.5.2 diff --git a/setup.py b/setup.py index 563a1f5c..1d8c3b13 100644 --- a/setup.py +++ b/setup.py @@ -341,6 +341,7 @@ def run_setup(with_extensions): 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], author='Alistair Miles', author_email='alimanfoo@googlemail.com', diff --git a/tox.ini b/tox.ini index c8ac9b29..f71d33d8 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27, py35, py36, docs +envlist = py27, py35, py36, py37, docs [testenv] setenv = @@ -14,10 +14,10 @@ setenv = py27: PY_MAJOR_VERSION = py2 commands = python setup.py build_ext --inplace - py27,py35: pytest -v --cov=numcodecs numcodecs - py36: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs + py27,py35,py36: pytest -v --cov=numcodecs numcodecs + py37: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs coverage report -m - py36: flake8 --max-line-length=100 numcodecs + py37: flake8 --max-line-length=100 numcodecs deps = py27: backports.lzma -rrequirements_dev.txt