Skip to content

Commit f51502c

Browse files
Jackson Maxfield Brownjakirkham
andauthored
Build + Support Py39 and Various CI Updates (#270)
* Support Py39 in tests * Remove old CI configs * Add or upgrade CI for GH-Actions * Update doc references to py39 * Remove references to py35 * Fix build docs check on linux ci * Test new README badge targets * Point badges at zarr-developers org * Update GitHub PR Template * More specificity in ci linux on os versions * Upgrade wheel CI to use py39 * Upgrade tox docs test to use py39 * Update cibuildwheel to support py39 * Add back pypi package classifiers * Swap wheel builds for ubuntu 18 + 20 for latest * Linux CI install deps instead of dev deps * Rename OSX steps + change env setup * Add Windows CI * Add newline character to ci-linux * Mark pickle backwards compat xfail on windows * Add link to GH Issue for windows xfail test Co-authored-by: jakirkham <[email protected]> Co-authored-by: jakirkham <[email protected]>
1 parent 06a0a3e commit f51502c

File tree

13 files changed

+157
-132
lines changed

13 files changed

+157
-132
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[Description of PR]
22

33
TODO:
4-
* [ ] Unit tests and/or doctests in docstrings
5-
* [ ] ``tox -e py38`` passes locally
6-
* [ ] Docstrings and API docs for any new/modified user-facing classes and functions
7-
* [ ] Changes documented in docs/release.rst
8-
* [ ] ``tox -e docs`` passes locally
9-
* [ ] AppVeyor and Travis CI passes
10-
* [ ] Test coverage to 100% (Coveralls passes)
4+
5+
- [ ] Unit tests and/or doctests in docstrings
6+
- [ ] `tox -e py39` passes locally
7+
- [ ] Docstrings and API docs for any new/modified user-facing classes and functions
8+
- [ ] Changes documented in docs/release.rst
9+
- [ ] `tox -e docs` passes locally
10+
- [ ] GitHub Actions CI passes
11+
- [ ] Test coverage to 100% (Coveralls passes)

.github/workflows/ci-linux.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Linux CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: ["3.6", "3.7", "3.8", "3.9"]
12+
os: [ubuntu-18.04, ubuntu-20.04]
13+
14+
steps:
15+
- name: Checkout source
16+
uses: actions/checkout@v2
17+
with:
18+
submodules: recursive
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install numcodecs
26+
run: |
27+
python -m pip install -U pip -r requirements_test.txt -r requirements.txt
28+
python -m pip install -v -e .
29+
30+
- name: List installed packages
31+
run: python -m pip list
32+
33+
- name: Run tests
34+
run: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs
35+
36+
- name: Flake8
37+
run: flake8 numcodecs
38+
39+
- name: Build Docs
40+
run: |
41+
pip install -r requirements_rtfd.txt
42+
cd docs
43+
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

.github/workflows/ci-osx.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ["3.6", "3.7", "3.8"]
11+
python-version: ["3.6", "3.7", "3.8", "3.9"]
1212

1313
steps:
1414
- name: Checkout source
@@ -23,13 +23,16 @@ jobs:
2323
python-version: ${{ matrix.python-version }}
2424
env:
2525
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
26-
- name: Install numcodecs
26+
27+
- name: Set up env
2728
shell: "bash -l {0}"
2829
run: |
29-
conda create -n env python==${{matrix.python-version}} wheel cython numpy msgpack-python pytest wheel pip compilers
30+
conda create -n env python==${{matrix.python-version}} wheel pip compilers
3031
conda activate env
3132
which pip
33+
pip install -r requirements_test.txt -r requirements.txt
3234
conda env export
35+
3336
- name: Install numcodecs
3437
shell: "bash -l {0}"
3538
run: |

.github/workflows/ci-windows.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Windows CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: ["3.6", "3.7", "3.8", "3.9"]
12+
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
19+
- name: Set up Python
20+
uses: conda-incubator/setup-miniconda@master
21+
with:
22+
channels: conda-forge
23+
python-version: ${{ matrix.python-version }}
24+
env:
25+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
26+
27+
- name: Set up env
28+
shell: "bash -l {0}"
29+
run: |
30+
conda create -n env python==${{matrix.python-version}} wheel pip compilers
31+
conda activate env
32+
which pip
33+
pip install -r requirements_test.txt -r requirements.txt
34+
conda env export
35+
36+
- name: Install numcodecs
37+
shell: "bash -l {0}"
38+
run: |
39+
conda activate env
40+
export CC=clang
41+
python setup.py build
42+
43+
- name: Run tests
44+
shell: "bash -l {0}"
45+
run: |
46+
conda activate env
47+
pytest -v --pyargs numcodecs

.github/workflows/wheel.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [ubuntu-18.04, windows-latest, macos-latest]
12+
os: [ubuntu-latest, windows-latest, macos-latest]
1313
env:
1414
CIBW_TEST_COMMAND: pytest --pyargs numcodecs
1515
CIBW_TEST_REQUIRES: pytest
@@ -25,11 +25,11 @@ jobs:
2525
- uses: actions/setup-python@v1
2626
name: Install Python
2727
with:
28-
python-version: '3.7'
28+
python-version: '3.9'
2929

3030
- name: Install cibuildwheel
3131
run: |
32-
python -m pip install cibuildwheel==1.3.0 wheel
32+
python -m pip install cibuildwheel==1.8.0 wheel
3333
3434
- name: Build wheel
3535
run: |
@@ -50,7 +50,7 @@ jobs:
5050
- uses: actions/setup-python@v2
5151
name: Install Python
5252
with:
53-
python-version: '3.7'
53+
python-version: '3.9'
5454

5555
- name: Build sdist
5656
run: python setup.py sdist

.travis.yml

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

README.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ codecs for use in data storage and communication applications.
77
.. image:: https://readthedocs.org/projects/numcodecs/badge/?version=latest
88
:target: http://numcodecs.readthedocs.io/en/latest/?badge=latest
99

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

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

1619
.. image:: https://coveralls.io/repos/github/zarr-developers/numcodecs/badge.svg?branch=master
1720
:target: https://coveralls.io/github/zarr-developers/numcodecs?branch=master

appveyor.yml

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

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.8 ~/pyenv/numcodecs-dev
93+
$ virtualenv --no-site-packages --python=/usr/bin/python3.9 ~/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 py35,py36,py37,py38
148+
$ tox -e py36,py37,py38,py39
149149

150-
NumCodecs currently supports Python 3.5-3.8, so the above command must
151-
succeed before code can be accepted into the main code base. Note that only the py38
152-
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.8.
150+
NumCodecs currently supports Python 6-3.9, so the above command must
151+
succeed before code can be accepted into the main code base. Note that only the py39
152+
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.9.
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 py38``.
167+
This is automatically run when invoking ``tox -e py39``.
168168

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

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

numcodecs/tests/test_pickles.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ def test_repr():
4343
check_repr("Pickle(protocol=-1)")
4444

4545

46-
@pytest.mark.skipif(sys.byteorder != 'little',
47-
reason='Pickle does not restore byte orders')
46+
# Details on xfail
47+
# https://stackoverflow.com/questions/58194852/modulenotfounderror-no-module-named-numpy-core-multiarray-r
48+
@pytest.mark.skipif(
49+
sys.byteorder != "little", reason="Pickle does not restore byte orders"
50+
)
51+
@pytest.mark.xfail(
52+
sys.platform == "win32", reason=(
53+
"Pickle fails to read w/ Windows carriage return "
54+
"( https://github.com/zarr-developers/numcodecs/issues/271 )"
55+
)
56+
)
4857
def test_backwards_compatibility():
4958
check_backwards_compatibility(Pickle.codec_id, arrays, codecs)

0 commit comments

Comments
 (0)