Skip to content

Commit

Permalink
Merge pull request #313 from t20100/ci
Browse files Browse the repository at this point in the history
CI: Updated configuration to use github actions and cibuildwheel; ZFP: Fixed compilation options for Visual Studio 2022
  • Loading branch information
kif authored Jul 10, 2024
2 parents e93963f + a8e8ca4 commit adebbe1
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 140 deletions.
108 changes: 42 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,62 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
runs-on: ${{ matrix.os }}
strategy:
# do not cancel tests after first fail
fail-fast: false
matrix:
include:
- name-suffix: "wheel-h5py_3.0.0"
os: ubuntu-latest
python-version: '3.7'
OLDEST_DEPENDENCIES: 'h5py==3.0.0 "numpy<2"'

- name-suffix: "sdist-h5py_3.6.0"
os: ubuntu-latest
python-version: '3.10'
OLDEST_DEPENDENCIES: 'h5py==3.6.0 "numpy<2"'

- name-suffix: "wheel-h5py_3.10.0"
os: ubuntu-latest
python-version: '3.12'
OLDEST_DEPENDENCIES: 'h5py==3.10.0 "numpy<2"'

- name-suffix: "wheel-h5py_3.0.0"
os: macos-13
python-version: '3.7.16'
OLDEST_DEPENDENCIES: 'h5py==3.0.0 "numpy<2"'
env:
MACOSX_DEPLOYMENT_TARGET: 10.15

- name-suffix: "wheel-h5py_3.10.0"
os: macos-13
python-version: '3.10.8'
OLDEST_DEPENDENCIES: 'h5py==3.10.0 "numpy<2"'

build_sdist:
name: Build sdist & documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '3.12'
cache: 'pip'
- name: Install build tool
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build
- name: Install wheel
run: pip install --pre "$(ls dist/hdf5plugin-*.whl)[test]" --only-binary blosc2 || pip install --pre dist/hdf5plugin-*.whl
- name: Run the tests with latest h5py
run: python test/test.py
- name: Run the tests with oldest h5py
run: |
pip install ${{ matrix.OLDEST_DEPENDENCIES }}
python test/test.py
- run: python -m pip install --upgrade pip build twine
- run: python -m build --sdist
- run: python -m twine check dist/*
# Build documentation
- run: sudo apt-get install pandoc
- run: pip install "$(ls ./dist/hdf5plugin-*.tar.gz)[doc]"
env:
HDF5PLUGIN_STRIP: all # Do not build the filters
- run: sphinx-build --fail-on-warning --keep-going -b html doc/ ./html

build_test:
name: ${{ matrix.cibw_build }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
cibw_build: "cp38-manylinux_x86_64"
- os: windows-2019
cibw_build: "cp38-win_amd64"
- os: macos-12
cibw_build: "cp38-macosx_x86_64"
- os: ubuntu-latest
cibw_build: "cp310-manylinux_x86_64"
- os: windows-latest
cibw_build: "cp311-win_amd64"
- os: macos-latest
cibw_build: "cp312-macosx_arm64"

build_wheels_macos:
name: Build ARM64 wheels on macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_BUILD: cp311-macosx_*
CIBW_ARCHS_MACOS: arm64
HDF5PLUGIN_SSE2: False
HDF5PLUGIN_SSSE3: False
HDF5PLUGIN_AVX2: False
HDF5PLUGIN_AVX512: False
HDF5PLUGIN_NATIVE: False
MACOSX_DEPLOYMENT_TARGET: "10.13"
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_TEST_EXTRAS: "test"
# Test twice: with latest version and with numpy v1 and oldest supported h5py
CIBW_TEST_COMMAND: >
python {project}/test/test.py &&
pip install -r {project}/ci/oldest_h5py.txt &&
python {project}/test/test.py
68 changes: 0 additions & 68 deletions appveyor.yml

This file was deleted.

5 changes: 5 additions & 0 deletions ci/oldest_h5py.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
numpy < 2
h5py == 3.10.0 ; python_version == '3.12'
h5py == 3.8.0 ; python_version == '3.11'
h5py == 3.6.0 ; python_version == '3.10'
h5py == 3.0.0 ; python_version <= '3.9'
6 changes: 3 additions & 3 deletions doc/information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Presentations

- :doc:`Presentation material <hdf5plugin_EuropeanHUG2023/presentation>`
(:download:`Notebook <hdf5plugin_EuropeanHUG2023/presentation.ipynb>`),
`Video <https://youtu.be/IyS_NgAwXuU>`_
`Video EuHUG2023 <https://youtu.be/IyS_NgAwXuU>`_
- Benchmark: :download:`script <hdf5plugin_EuropeanHUG2023/benchmark.py>`, :download:`display notebook <hdf5plugin_EuropeanHUG2023/benchmark.ipynb>`
- :doc:`HDF5 compressed chunk direct read example <hdf5plugin_EuropeanHUG2023/hdf5_compressed_chunk_direct_read>`
(:download:`Notebook <hdf5plugin_EuropeanHUG2023/hdf5_compressed_chunk_direct_read.ipynb>`)
Expand All @@ -52,14 +52,14 @@ Presentations

- :doc:`Presentation material <hdf5plugin_EuropeanHUG2022>`
(:download:`Notebook <hdf5plugin_EuropeanHUG2022.ipynb>`),
`Video <https://youtu.be/Titp1XRBh9k>`_
`Video EuHUG2022 <https://youtu.be/Titp1XRBh9k>`_


* :doc:`Presentation <hdf5plugin_EuropeanHUG2021>` at the `European HDF Users Group (HUG) Summer 2021 <https://www.hdfgroup.org/hug/europeanhug21/>`_:

- :doc:`Presentation material <hdf5plugin_EuropeanHUG2021>`
(:download:`Notebook <hdf5plugin_EuropeanHUG2021.ipynb>`),
`Video <https://youtu.be/DP-r2omEnrg>`_
`Video EuHUG2021 <https://youtu.be/DP-r2omEnrg>`_


HDF5 filters and compression libraries
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ doc = [
"sphinx_rtd_theme",
]
test = [
"blosc2>=2.5.1",
"blosc2-grok>=0.2.2",
"blosc2>=2.5.1;python_version>='3.9'",
"blosc2-grok>=0.2.2;python_version>='3.9'",
]

[tool.setuptools]
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,9 @@ def get_sperr_clib(field=None):
def get_zfp_clib(field=None):
"""ZFP static lib build config"""
cflags = ['-O3', '-ffast-math', '-std=c99', '-fopenmp']
cflags += ['/Ox', '/fp:fast', '/openmp']
# Use /Ob1 to fix ZFP test failing with Visual Studio 2022: MSVC 14.40.33807
# See https://github.com/LLNL/zfp/issues/222
cflags += ['/Ob1', '/fp:fast', '/openmp']

zfp_dir = "src/zfp"

Expand Down

0 comments on commit adebbe1

Please sign in to comment.