File tree Expand file tree Collapse file tree 3 files changed +60
-3
lines changed Expand file tree Collapse file tree 3 files changed +60
-3
lines changed Original file line number Diff line number Diff line change 4343 - name : Run Tests
4444 run : |
4545 hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run
46+
47+ upstream :
48+ name : py=${{ matrix.python-version }}-upstream
49+
50+ runs-on : ubuntu-latest
51+ strategy :
52+ matrix :
53+ python-version : ['3.13']
54+
55+ steps :
56+ - uses : actions/checkout@v4
57+ - name : Set up Python
58+ uses : actions/setup-python@v5
59+ with :
60+ python-version : ${{ matrix.python-version }}
61+ cache : ' pip'
62+ - name : Install Hatch
63+ run : |
64+ python -m pip install --upgrade pip
65+ pip install hatch
66+ - name : Set Up Hatch Env
67+ run : |
68+ hatch env create upstream
69+ hatch env run -e upstream list-env
70+ - name : Run Tests
71+ run : |
72+ hatch env run --env upstream run
Original file line number Diff line number Diff line change @@ -183,6 +183,35 @@ features = ['docs']
183183build = " cd docs && make html"
184184serve = " sphinx-autobuild docs docs/_build --host 0.0.0.0"
185185
186+ [tool .hatch .envs .upstream ]
187+ dependencies = [
188+ ' numpy>=2.2.0.dev0' ,
189+ ' numcodecs @ git+https://github.com/zarr-developers/numcodecs' ,
190+ ' fsspec @ git+https://github.com/fsspec/filesystem_spec' ,
191+ ' s3fs @ git+https://github.com/fsspec/s3fs' ,
192+ ' universal_pathlib @ git+https://github.com/fsspec/universal_pathlib' ,
193+ ' crc32c @ git+https://github.com/ICRAR/crc32c' ,
194+ ' typing_extensions @ git+https://github.com/python/typing_extensions' ,
195+ ' donfig @ git+https://github.com/pytroll/donfig' ,
196+ # test deps
197+ ' hypothesis' ,
198+ ' pytest' ,
199+ ' pytest-cov' ,
200+ ' pytest-asyncio' ,
201+ ' moto[s3]' ,
202+ ]
203+
204+ # help! this is not working for numpy :(
205+ [tool .hatch .envs .upstream .env-vars ]
206+ PIP_EXTRA_INDEX_URL = " https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
207+ PIP_PRE = " 1"
208+
209+ [tool .hatch .envs .upstream .scripts ]
210+ run = " pytest --verbose"
211+ run-mypy = " mypy src"
212+ run-hypothesis = " pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
213+ list-env = " pip list"
214+
186215[tool .ruff ]
187216line-length = 100
188217force-exclude = true
Original file line number Diff line number Diff line change 33import asyncio
44from dataclasses import dataclass
55from functools import cached_property
6- from importlib .metadata import version
76from typing import TYPE_CHECKING
87
8+ import numcodecs
99from numcodecs .zstd import Zstd
10+ from packaging .version import Version
1011
1112from zarr .abc .codec import BytesBytesCodec
1213from zarr .core .buffer .cpu import as_numpy_array_wrapper
@@ -43,8 +44,8 @@ class ZstdCodec(BytesBytesCodec):
4344
4445 def __init__ (self , * , level : int = 0 , checksum : bool = False ) -> None :
4546 # numcodecs 0.13.0 introduces the checksum attribute for the zstd codec
46- _numcodecs_version = tuple ( map ( int , version ( " numcodecs" ). split ( "." )) )
47- if _numcodecs_version < ( 0 , 13 , 0 ): # pragma: no cover
47+ _numcodecs_version = Version ( numcodecs . __version__ )
48+ if _numcodecs_version < Version ( "0.13.0" ):
4849 raise RuntimeError (
4950 "numcodecs version >= 0.13.0 is required to use the zstd codec. "
5051 f"Version { _numcodecs_version } is currently installed."
You can’t perform that action at this time.
0 commit comments