Skip to content

Commit bd4243c

Browse files
authored
Merge pull request #396 from t20100/update-ci
Update CI
2 parents a1acc8f + 08e072d commit bd4243c

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
name: Build sdist & documentation
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
16-
- uses: actions/setup-python@v5
15+
- uses: actions/checkout@v7
16+
- uses: actions/setup-python@v6
1717
with:
1818
python-version: '3.12'
1919
cache: 'pip'
@@ -44,11 +44,11 @@ jobs:
4444
- os: ubuntu-latest
4545
cibw_build: "cp312-manylinux_x86_64"
4646
- os: macos-latest
47-
cibw_build: "cp313-macosx_arm64"
47+
cibw_build: "cp314-macosx_arm64"
4848

4949
steps:
50-
- uses: actions/checkout@v5
51-
- uses: pypa/cibuildwheel@v3.1.4
50+
- uses: actions/checkout@v7
51+
- uses: pypa/cibuildwheel@v4.1.0
5252
env:
5353
MACOSX_DEPLOYMENT_TARGET: "10.13"
5454
CIBW_BUILD_VERBOSITY: 1

.github/workflows/release.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
name: Build and test source distribution
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
15-
- uses: actions/setup-python@v5
14+
- uses: actions/checkout@v7
15+
- uses: actions/setup-python@v6
1616
with:
1717
python-version: '3.12'
1818
cache: 'pip'
@@ -21,18 +21,19 @@ jobs:
2121
- run: python -m build --sdist
2222
- run: python -m twine check dist/*
2323
- run: pip install --pre "$(ls dist/hdf5plugin*.tar.gz)[test]"
24+
- run: pip uninstall -y blosc2_grok # https://github.com/silx-kit/hdf5plugin/issues/377
2425
- run: python test/test.py
25-
- uses: actions/upload-artifact@v4
26+
- uses: actions/upload-artifact@v7
2627
with:
27-
name: cibw-sdist
28-
path: dist/*.tar.gz
28+
path: dist/hdf5plugin-*.tar.gz
29+
archive: false
2930

3031
build_doc:
3132
name: Build documentation
3233
runs-on: ubuntu-latest
3334
steps:
34-
- uses: actions/checkout@v5
35-
- uses: actions/setup-python@v5
35+
- uses: actions/checkout@v7
36+
- uses: actions/setup-python@v6
3637
with:
3738
python-version: "3.12"
3839
cache: "pip"
@@ -45,10 +46,10 @@ jobs:
4546
export OUTPUT_NAME="hdf5plugin-$(python -c 'import hdf5plugin; print(hdf5plugin.version)')_documentation"
4647
sphinx-build doc/ "${OUTPUT_NAME}/"
4748
zip -r "${OUTPUT_NAME}.zip" "${OUTPUT_NAME}/"
48-
- uses: actions/upload-artifact@v4
49+
- uses: actions/upload-artifact@v7
4950
with:
50-
name: documentation
5151
path: hdf5plugin-*_documentation.zip
52+
archive: false
5253

5354
build_wheels:
5455
name: Build wheels on ${{ matrix.os }}-${{ matrix.cibw_archs }}
@@ -78,12 +79,12 @@ jobs:
7879
with_sse2: false
7980

8081
steps:
81-
- uses: actions/checkout@v5
82-
- uses: docker/setup-qemu-action@v3
82+
- uses: actions/checkout@v7
83+
- uses: docker/setup-qemu-action@v4
8384
if: runner.os == 'Linux' && runner.arch == 'X64'
8485
with:
8586
platforms: all
86-
- uses: pypa/cibuildwheel@v3.3.1
87+
- uses: pypa/cibuildwheel@v4.1.0
8788
env:
8889
# Configure hdf5plugin build
8990
HDF5PLUGIN_OPENMP: "False"
@@ -108,12 +109,12 @@ jobs:
108109
CIBW_ARCHS: ${{ matrix.cibw_archs }}
109110

110111
CIBW_TEST_SKIP: "*-*linux_ppc64le"
111-
CIBW_BEFORE_TEST: pip install h5py --only-binary ":all:"
112+
CIBW_BEFORE_TEST: pip install packaging h5py --only-binary ":all:"
112113
CIBW_TEST_COMMAND: python {project}/test/test.py
113-
- uses: actions/upload-artifact@v4
114+
- uses: actions/upload-artifact@v7
114115
with:
115-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
116-
path: ./wheelhouse/*.whl
116+
path: ./wheelhouse/hdf5plugin-*.whl
117+
archive: false
117118

118119
test_wheels:
119120
needs: [build_wheels]
@@ -137,21 +138,23 @@ jobs:
137138
OLDEST_DEPENDENCIES: 'h5py==3.15.1 numpy==2.4.1'
138139

139140
steps:
140-
- uses: actions/checkout@v5
141-
- uses: actions/setup-python@v5
141+
- uses: actions/checkout@v7
142+
- uses: actions/setup-python@v6
142143
with:
143144
python-version: ${{ matrix.python-version }}
144145
cache: 'pip'
145-
- uses: actions/download-artifact@v5
146+
- uses: actions/download-artifact@v8
146147
with:
147-
pattern: cibw-wheels-*
148+
pattern: hdf5plugin-*.whl
148149
path: dist
149150
merge-multiple: true
151+
skip-decompress: true
150152
- name: Install hdf5plugin
151153
# First select the right wheel from dist/ with pip download, then install it
152154
run: |
153155
pip download --no-index --no-cache --no-deps --find-links=./dist --only-binary :all: hdf5plugin
154156
pip install "$(ls ./hdf5plugin-*.whl)[test]"
157+
pip uninstall -y blosc2_grok # https://github.com/silx-kit/hdf5plugin/issues/377
155158
- name: Run test with latest h5py
156159
run: python test/test.py
157160
- name: Run test with oldest h5py
@@ -171,9 +174,10 @@ jobs:
171174
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
172175
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
173176
steps:
174-
- uses: actions/download-artifact@v5
177+
- uses: actions/download-artifact@v8
175178
with:
176-
pattern: cibw-*
179+
pattern: hdf5plugin-*.{whl,tar.gz}
177180
path: dist
178181
merge-multiple: true
182+
skip-decompress: true
179183
- uses: pypa/gh-action-pypi-publish@release/v1

ci/oldest_h5py.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
numpy < 2 ; python_version <= '3.12'
2+
h5py == 3.15.0 ; python_version == '3.14'
3+
h5py == 3.12.1 ; python_version == '3.13'
24
h5py == 3.10.0 ; python_version == '3.12'
35
h5py == 3.8.0 ; python_version == '3.11'
46
h5py == 3.6.0 ; python_version == '3.10'

test/test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ def testBlosc(self):
6868
self.assertTrue(data.shape[1] == 100, "Incorrect shape")
6969
self.assertTrue(data.shape[2] == 100, "Incorrect shape")
7070

71-
target = numpy.arange(numpy.prod(expected_shape), dtype=numpy.float64)
72-
target.shape = expected_shape
71+
target = numpy.arange(numpy.prod(expected_shape), dtype=numpy.float64).reshape(
72+
expected_shape
73+
)
7374
self.assertTrue(numpy.allclose(data, target), "Incorrect readout")
7475

7576
@unittest.skipUnless(
@@ -304,10 +305,9 @@ def testSZ3(self):
304305
)
305306

306307
# see what relative and absolute differences are acceptable for this mode
307-
difference = original - compressed_back
308+
difference = numpy.ravel(original - compressed_back)
308309
idx = numpy.argmax(abs(difference))
309-
difference.shape = -1
310-
rtol = abs(difference[idx] / original.flatten()[idx])
310+
rtol = abs(difference[idx] / numpy.ravel(original)[idx])
311311

312312
# TODO: Check why one needs to have such large tolerance
313313
rtol = rtol * 5

0 commit comments

Comments
 (0)