File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import asyncio
4+ import math
45from dataclasses import dataclass , replace
56from functools import cached_property
6- import math
7- from typing_extensions import Self
87from warnings import warn
98
109import numpy as np
10+ from typing_extensions import Self
11+
1112import numcodecs
1213
1314try :
1819except ImportError :
1920 raise ImportError ("zarr 3.0.0 or later is required to use the numcodecs zarr integration." )
2021
21- from zarr .abc .codec import ArrayArrayCodec , BytesBytesCodec , ArrayBytesCodec
22- from zarr .core .buffer import NDBuffer , Buffer , BufferPrototype
23- from zarr .core .buffer .cpu import as_numpy_array_wrapper
22+ from zarr .abc .codec import ArrayArrayCodec , ArrayBytesCodec , BytesBytesCodec
2423from zarr .core .array_spec import ArraySpec
24+ from zarr .core .buffer import Buffer , BufferPrototype , NDBuffer
25+ from zarr .core .buffer .cpu import as_numpy_array_wrapper
2526from zarr .core .common import (
2627 JSON ,
2728 parse_named_configuration ,
2829 product ,
2930)
3031from zarr .core .metadata import ArrayMetadata
3132
32-
3333CODEC_PREFIX = "numcodecs."
3434
3535
Original file line number Diff line number Diff line change 11from __future__ import annotations
2+
23import pytest
34
45
56def test_zarr3_import ():
7+ ERROR_MESSAGE_MATCH = "zarr 3.0.0 or later.*"
8+
69 try :
710 import zarr
8- except ImportError :
9- pass
1011
11- if zarr is None or zarr .__version__ < "3.0.0" :
12- with pytest .raises (ImportError ):
12+ if zarr .__version__ < "3.0.0" :
13+ with pytest .raises (ImportError , match = ERROR_MESSAGE_MATCH ):
14+ import numcodecs ._zarr3 # noqa: F401
15+ except ImportError :
16+ with pytest .raises (ImportError , match = ERROR_MESSAGE_MATCH ):
1317 import numcodecs ._zarr3 # noqa: F401
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ doctest_optionflags = [
132132 " IGNORE_EXCEPTION_DETAIL" ,
133133]
134134testpaths = [
135- " numcodecs" ,
135+ " numcodecs/tests " ,
136136]
137137norecursedirs = [
138138 " .git" ,
You can’t perform that action at this time.
0 commit comments