Skip to content

Commit 1bf63a0

Browse files
(fix): upper bound zarr at runtime (and in docs + benchmark) (#1819)
* (fix): upper bound zarr at runtime * (chore): improve message * (fix): asv benchmarking config * (chore): fix docs * (fix): intersphinx mapping * (chore): release note * simpler version * (refactor): `ImportError` instead of `RuntimeError` --------- Co-authored-by: Philipp A. <flying-sheep@web.de>
1 parent a8c62e8 commit 1bf63a0

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

benchmarks/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"natsort": [""],
8080
"pandas": [""],
8181
"memory_profiler": [""],
82-
"zarr": [""],
82+
"zarr": ["2.18.4"],
8383
"pytoml": [""],
8484
"pytest": [""],
8585
"pooch": [""],

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def setup(app: Sphinx):
132132
python=("https://docs.python.org/3", None),
133133
scipy=("https://docs.scipy.org/doc/scipy", None),
134134
sklearn=("https://scikit-learn.org/stable", None),
135-
zarr=("https://zarr.readthedocs.io/en/stable", None),
135+
zarr=("https://zarr.readthedocs.io/en/v2.18.4/", None),
136136
xarray=("https://docs.xarray.dev/en/stable", None),
137137
dask=("https://docs.dask.org/en/stable", None),
138138
)

docs/release-notes/1819.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upper bound `zarr` at runtime {user}`ilan-gold`

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ doc = [
7474
"sphinxext.opengraph",
7575
"nbsphinx",
7676
"scanpydoc[theme,typehints] >=0.14.1",
77-
"zarr",
77+
"zarr<3",
7878
"awkward>=2.3",
7979
"IPython", # For syntax highlighting in notebooks
8080
"myst_parser",
@@ -88,7 +88,7 @@ test = [
8888
"loompy>=3.0.5",
8989
"pytest>=8.2,<8.3.4",
9090
"pytest-cov>=2.10",
91-
"zarr<3.0.0a0",
91+
"zarr<3",
9292
"matplotlib",
9393
"scikit-learn",
9494
"openpyxl",

src/anndata/compat/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ def __exit__(self, *_exc_info) -> None:
9191
#############################
9292

9393
if find_spec("zarr") or TYPE_CHECKING:
94+
import zarr
95+
96+
if Version(zarr.__version__).major > 2:
97+
raise ImportError("zarr-python major version > 2 is not supported")
98+
9499
from zarr.core import Array as ZarrArray
95100
from zarr.hierarchy import Group as ZarrGroup
96101
else:

0 commit comments

Comments
 (0)