Skip to content

Commit 8c37d5d

Browse files
committed
fixes for ci
1 parent 2654737 commit 8c37d5d

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,19 @@ jobs:
6363
# TODO: put back zfpy import when it supports numpy 2.0
6464
python -m pip install -v -e .[test,test_extras,msgpack,pcodec]
6565
66-
# This is used to test with zfpy, which does not yet support numpy 2.0
67-
- name: Install older numpy and zfpy
68-
if: matrix.python-version == '3.10'
66+
- name: Install zarr-python
6967
shell: "bash -l {0}"
7068
run: |
7169
conda activate env
72-
python -m pip install "zfpy>=1" "numpy<2"
70+
python -m pip install zarr==3.0.0a0
7371
74-
- name: Install zarr-python
72+
# This is used to test with zfpy, which does not yet support numpy 2.0
73+
- name: Install older numpy and zfpy
74+
if: matrix.python-version == '3.10'
7575
shell: "bash -l {0}"
76-
if: ${{ matrix.python-version != '3.8' && matrix.python-version != '3.9' }}
7776
run: |
7877
conda activate env
79-
python -m pip install zarr==3.0.0a0
78+
python -m pip install "zfpy>=1" "numpy<2"
8079
8180
- name: List installed packages
8281
shell: "bash -l {0}"

numcodecs/tests/test_zarr3.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ def test_generic_checksum(store: Store, codec_id: str):
180180
def test_generic_bytes_codec(store: Store, codec_id: str):
181181
data = np.arange(0, 256, dtype="float32").reshape((16, 16))
182182

183+
try:
184+
codec_class = get_codec_class(f"numcodecs.{codec_id}")
185+
except ValueError as e:
186+
# zfpy is not available on all platforms and versions
187+
if "codec not available" in str(e):
188+
return
189+
else:
190+
raise
191+
183192
with pytest.warns(UserWarning, match="Numcodecs.*"):
184193
a = Array.create(
185194
store / "generic",
@@ -188,7 +197,7 @@ def test_generic_bytes_codec(store: Store, codec_id: str):
188197
dtype=data.dtype,
189198
fill_value=0,
190199
codecs=[
191-
get_codec_class(f"numcodecs.{codec_id}")({"id": codec_id}),
200+
codec_class({"id": codec_id}),
192201
],
193202
)
194203

0 commit comments

Comments
 (0)