Skip to content

Build + Support Py39 and Various CI Updates #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[Description of PR]

TODO:
* [ ] Unit tests and/or doctests in docstrings
* [ ] ``tox -e py38`` passes locally
* [ ] Docstrings and API docs for any new/modified user-facing classes and functions
* [ ] Changes documented in docs/release.rst
* [ ] ``tox -e docs`` passes locally
* [ ] AppVeyor and Travis CI passes
* [ ] Test coverage to 100% (Coveralls passes)

- [ ] Unit tests and/or doctests in docstrings
- [ ] `tox -e py39` passes locally
- [ ] Docstrings and API docs for any new/modified user-facing classes and functions
- [ ] Changes documented in docs/release.rst
- [ ] `tox -e docs` passes locally
- [ ] GitHub Actions CI passes
- [ ] Test coverage to 100% (Coveralls passes)
43 changes: 43 additions & 0 deletions .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Linux CI

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
os: [ubuntu-18.04, ubuntu-20.04]

steps:
- name: Checkout source
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install numcodecs
run: |
python -m pip install -U pip -r requirements_test.txt -r requirements.txt
python -m pip install -v -e .

- name: List installed packages
run: python -m pip list

- name: Run tests
run: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs

- name: Flake8
run: flake8 numcodecs

- name: Build Docs
run: |
pip install -r requirements_rtfd.txt
cd docs
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
9 changes: 6 additions & 3 deletions .github/workflows/ci-osx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- name: Checkout source
Expand All @@ -23,13 +23,16 @@ jobs:
python-version: ${{ matrix.python-version }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Install numcodecs

- name: Set up env
shell: "bash -l {0}"
run: |
conda create -n env python==${{matrix.python-version}} wheel cython numpy msgpack-python pytest wheel pip compilers
conda create -n env python==${{matrix.python-version}} wheel pip compilers
conda activate env
which pip
pip install -r requirements_test.txt -r requirements.txt
conda env export

- name: Install numcodecs
shell: "bash -l {0}"
run: |
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Windows CI

on: [push, pull_request]

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- name: Checkout source
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Python
uses: conda-incubator/setup-miniconda@master
with:
channels: conda-forge
python-version: ${{ matrix.python-version }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Set up env
shell: "bash -l {0}"
run: |
conda create -n env python==${{matrix.python-version}} wheel pip compilers
conda activate env
which pip
pip install -r requirements_test.txt -r requirements.txt
conda env export

- name: Install numcodecs
shell: "bash -l {0}"
run: |
conda activate env
export CC=clang
python setup.py build

- name: Run tests
shell: "bash -l {0}"
run: |
conda activate env
pytest -v --pyargs numcodecs
8 changes: 4 additions & 4 deletions .github/workflows/wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
CIBW_TEST_COMMAND: pytest --pyargs numcodecs
CIBW_TEST_REQUIRES: pytest
Expand All @@ -25,11 +25,11 @@ jobs:
- uses: actions/setup-python@v1
name: Install Python
with:
python-version: '3.7'
python-version: '3.9'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.3.0 wheel
python -m pip install cibuildwheel==1.8.0 wheel

- name: Build wheel
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
python-version: '3.9'

- name: Build sdist
run: python setup.py sdist
Expand Down
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ codecs for use in data storage and communication applications.
.. image:: https://readthedocs.org/projects/numcodecs/badge/?version=latest
:target: http://numcodecs.readthedocs.io/en/latest/?badge=latest

.. image:: https://travis-ci.org/zarr-developers/numcodecs.svg?branch=master
:target: https://travis-ci.org/zarr-developers/numcodecs
.. image:: https://github.com/zarr-developers/numcodecs/workflows/Linux%20CI/badge.svg?branch=master
:target: https://github.com/zarr-developers/numcodecs/actions?query=workflow%3A%22Linux+CI%22

.. image:: https://ci.appveyor.com/api/projects/status/jhaaaxotvel24n9g?svg=true
:target: https://ci.appveyor.com/project/zarr-developers/numcodecs
.. image:: https://github.com/zarr-developers/numcodecs/workflows/OSX%20CI/badge.svg?branch=master
:target: https://github.com/zarr-developers/numcodecs/actions?query=workflow%3A%22OSX+CI%22

.. image:: https://github.com/zarr-developers/numcodecs/workflows/Wheels/badge.svg?branch=master
:target: https://github.com/zarr-developers/numcodecs/actions?query=workflow%3AWheels

.. image:: https://coveralls.io/repos/github/zarr-developers/numcodecs/badge.svg?branch=master
:target: https://coveralls.io/github/zarr-developers/numcodecs?branch=master
42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

18 changes: 9 additions & 9 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.8 ~/pyenv/numcodecs-dev
$ virtualenv --no-site-packages --python=/usr/bin/python3.9 ~/pyenv/numcodecs-dev
$ source ~/pyenv/numcodecs-dev/bin/activate
$ pip install -r requirements_dev.txt
$ python setup.py build_ext --inplace
Expand Down Expand Up @@ -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 py35,py36,py37,py38
$ tox -e py36,py37,py38,py39

NumCodecs currently supports Python 3.5-3.8, so the above command must
succeed before code can be accepted into the main code base. Note that only the py38
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.8.
NumCodecs currently supports Python 6-3.9, so the above command must
succeed before code can be accepted into the main code base. Note that only the py39
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.9.

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
Expand All @@ -164,14 +164,14 @@ Conformance can be checked by running::

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

This is automatically run when invoking ``tox -e py38``.
This is automatically run when invoking ``tox -e py39``.

Test coverage
~~~~~~~~~~~~~

NumCodecs maintains 100% test coverage under the latest Python stable release (currently
Python 3.8). Both unit tests and docstring doctests are included when computing
coverage. Running ``tox -e py38`` will automatically run the test suite with coverage
Python 3.9). Both unit tests and docstring doctests are included when computing
coverage. Running ``tox -e py39`` 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.

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

NumCodecs uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.
Expand Down
13 changes: 11 additions & 2 deletions numcodecs/tests/test_pickles.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ def test_repr():
check_repr("Pickle(protocol=-1)")


@pytest.mark.skipif(sys.byteorder != 'little',
reason='Pickle does not restore byte orders')
# Details on xfail
# https://stackoverflow.com/questions/58194852/modulenotfounderror-no-module-named-numpy-core-multiarray-r
@pytest.mark.skipif(
sys.byteorder != "little", reason="Pickle does not restore byte orders"
)
@pytest.mark.xfail(
sys.platform == "win32", reason=(
"Pickle fails to read w/ Windows carriage return "
"( https://github.com/zarr-developers/numcodecs/issues/271 )"
)
)
def test_backwards_compatibility():
check_backwards_compatibility(Pickle.codec_id, arrays, codecs)
6 changes: 3 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Cython==0.29.6
msgpack==0.6.1
numpy==1.16.2
Cython==0.29.21
msgpack==1.0.2
numpy==1.19.0
25 changes: 13 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,19 @@ def run_setup(with_extensions):
python_requires=">=3.6, <4",
packages=["numcodecs", "numcodecs.tests"],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Operating System :: Unix',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: Unix",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
author='Alistair Miles',
author_email='[email protected]',
Expand Down
Loading