Skip to content

Commit 8cb3837

Browse files
authored
Exclude bad version of numcodecs & fix bsddb3 doctests (#2544)
* Exclude bad version of numcodecs Actually exclude bad version of numcodecs Fix changelog entry * Add pytest-doctestplus doc dep Fix doctest requires Try bumping version of pytest-doctestplus Fixup doctest requires * Exclude other bad version of numcodecs * Add pytest doctestplus extension * Fix skipping in docstring * Remove bsddb3 tests * Pin max version of numpy
1 parent ed94877 commit 8cb3837

File tree

10 files changed

+15
-83
lines changed

10 files changed

+15
-83
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"sphinx_issues",
4545
"sphinx_copybutton",
4646
"sphinx_design",
47+
"pytest_doctestplus.sphinx.doctestplus",
4748
]
4849

4950
numpydoc_show_class_members = False

docs/release.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Maintenance
3636
``zarr-python`` if you can install it, but to reduce our maintenance
3737
burden we will no longer run our compatibility tests for it.
3838
By :user:`David Stansby <dstansby>` (:issue:`2344`).
39+
* Excluded versions 0.14.0 and 0.14.1 of numcodecs, due to a bug in the implementation of
40+
the Delta filter (see https://github.com/zarr-developers/numcodecs/issues/653 for more information).
41+
By :user:`David Stansby <dstansby>` (:issue:`2544`).
3942

4043
Deprecations
4144
~~~~~~~~~~~~

docs/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ Another storage alternative is the :class:`zarr.storage.DBMStore` class, added
809809
in Zarr version 2.2. This class allows any DBM-style database to be used for
810810
storing an array or group. Here is an example using a Berkeley DB B-tree
811811
database for storage (requires `bsddb3
812-
<https://www.jcea.es/programacion/pybsddb.htm>`_ to be installed)::
812+
<https://www.jcea.es/programacion/pybsddb.htm>`_ to be installed):
813813

814814
.. doctest-requires:: bsddb3
815815

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ maintainers = [{ name = "Alistair Miles", email = "alimanfoo@googlemail.com" }]
1111
requires-python = ">=3.11"
1212
dependencies = [
1313
'asciitree',
14-
'numpy>=1.24',
14+
'numpy>=1.24,<2.2',
1515
'fasteners; sys_platform != "emscripten"',
16-
'numcodecs>=0.10.0',
16+
'numcodecs>=0.10.0,!=0.14.0,!=0.14.1',
1717
]
1818
dynamic = ["version"]
1919
classifiers = [
@@ -42,7 +42,8 @@ docs = [
4242
'sphinx-copybutton',
4343
'pydata-sphinx-theme',
4444
'numpydoc',
45-
'numcodecs[msgpack]',
45+
'numcodecs[msgpack]!=0.14.0,!=0.14.1',
46+
'pytest-doctestplus',
4647
]
4748

4849
[project.urls]

requirements_dev_optional.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pymongo==4.10.1
1515
# optional test requirements
1616
coverage
1717
pytest-cov==5.0.0
18-
pytest-doctestplus==1.2.1
18+
pytest-doctestplus==1.3.0
1919
pytest-timeout==2.3.1
2020
h5py==3.12.1
2121
fsspec==2023.12.2

zarr/storage.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,13 +2069,11 @@ class DBMStore(Store):
20692069
<https://www.jcea.es/programacion/pybsddb.htm>`_ package is installed, a
20702070
Berkeley DB database can be used::
20712071
2072-
.. doctest-requires:: bsddb3
2073-
2074-
>>> import bsddb3
2075-
>>> store = zarr.DBMStore('data/array.bdb', open=bsddb3.btopen)
2076-
>>> z = zarr.zeros((10, 10), chunks=(5, 5), store=store, overwrite=True)
2077-
>>> z[...] = 42
2078-
>>> store.close()
2072+
>>> import bsddb3 # doctest: +SKIP
2073+
>>> store = zarr.DBMStore('data/array.bdb', open=bsddb3.btopen) # doctest: +SKIP
2074+
>>> z = zarr.zeros((10, 10), chunks=(5, 5), store=store, overwrite=True) # doctest: +SKIP
2075+
>>> z[...] = 42 # doctest: +SKIP
2076+
>>> store.close() # doctest: +SKIP
20792077
20802078
Notes
20812079
-----

zarr/tests/test_core.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import atexit
2-
import os
32
import sys
43
import pickle
54
import shutil
@@ -75,7 +74,6 @@
7574
from zarr.util import buffer_size
7675
from zarr.tests.util import (
7776
abs_container,
78-
have_bsddb3,
7977
have_fsspec,
8078
have_lmdb,
8179
have_sqlite3,
@@ -2046,20 +2044,6 @@ def test_nbytes_stored(self):
20462044
pass # not implemented
20472045

20482046

2049-
@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3")
2050-
class TestArrayWithDBMStoreBerkeleyDB(TestArray):
2051-
def create_store(self):
2052-
import bsddb3
2053-
2054-
path = mktemp(suffix=".dbm")
2055-
atexit.register(os.remove, path)
2056-
store = DBMStore(path, flag="n", open=bsddb3.btopen)
2057-
return store
2058-
2059-
def test_nbytes_stored(self):
2060-
pass # not implemented
2061-
2062-
20632047
@pytest.mark.skipif(have_lmdb is False, reason="needs lmdb")
20642048
class TestArrayWithLMDBStore(TestArray):
20652049
def create_store(self):
@@ -2767,21 +2751,6 @@ def test_nbytes_stored(self):
27672751
pass # not implemented
27682752

27692753

2770-
@pytest.mark.skipif(not v3_api_available, reason="V3 is disabled")
2771-
@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3")
2772-
class TestArrayWithDBMStoreV3BerkeleyDB(TestArrayV3):
2773-
def create_store(self) -> DBMStoreV3:
2774-
import bsddb3
2775-
2776-
path = mktemp(suffix=".dbm")
2777-
atexit.register(os.remove, path)
2778-
store = DBMStoreV3(path, flag="n", open=bsddb3.btopen)
2779-
return store
2780-
2781-
def test_nbytes_stored(self):
2782-
pass # not implemented
2783-
2784-
27852754
@pytest.mark.skipif(not v3_api_available, reason="V3 is disabled")
27862755
@pytest.mark.skipif(have_lmdb is False, reason="needs lmdb")
27872756
class TestArrayWithLMDBStoreV3(TestArrayV3):

zarr/tests/test_hierarchy.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,27 +1439,6 @@ def create_store():
14391439
return store, None
14401440

14411441

1442-
class TestGroupWithDBMStoreBerkeleyDB(TestGroup):
1443-
@staticmethod
1444-
def create_store():
1445-
bsddb3 = pytest.importorskip("bsddb3")
1446-
path = mktemp(suffix=".dbm")
1447-
atexit.register(os.remove, path)
1448-
store = DBMStore(path, flag="n", open=bsddb3.btopen)
1449-
return store, None
1450-
1451-
1452-
@pytest.mark.skipif(not v3_api_available, reason="V3 is disabled")
1453-
class TestGroupV3WithDBMStoreBerkeleyDB(TestGroupWithDBMStoreBerkeleyDB, TestGroupV3):
1454-
@staticmethod
1455-
def create_store():
1456-
bsddb3 = pytest.importorskip("bsddb3")
1457-
path = mktemp(suffix=".dbm")
1458-
atexit.register(os.remove, path)
1459-
store = DBMStoreV3(path, flag="n", open=bsddb3.btopen)
1460-
return store, None
1461-
1462-
14631442
class TestGroupWithLMDBStore(TestGroup):
14641443
@staticmethod
14651444
def create_store():

zarr/tests/test_storage.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,15 +1932,6 @@ def create_store(self, **kwargs):
19321932
return store # pragma: no cover
19331933

19341934

1935-
class TestDBMStoreBerkeleyDB(TestDBMStore):
1936-
def create_store(self, **kwargs):
1937-
bsddb3 = pytest.importorskip("bsddb3")
1938-
path = mktemp(suffix=".dbm")
1939-
atexit.register(os.remove, path)
1940-
store = DBMStore(path, flag="n", open=bsddb3.btopen, write_lock=False, **kwargs)
1941-
return store
1942-
1943-
19441935
class TestLMDBStore(StoreTests):
19451936
def create_store(self, **kwargs):
19461937
pytest.importorskip("lmdb")

zarr/tests/test_storage_v3.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
from .test_storage import TestABSStore as _TestABSStore
5454
from .test_storage import TestConsolidatedMetadataStore as _TestConsolidatedMetadataStore
5555
from .test_storage import TestDBMStore as _TestDBMStore
56-
from .test_storage import TestDBMStoreBerkeleyDB as _TestDBMStoreBerkeleyDB
5756
from .test_storage import TestDBMStoreDumb as _TestDBMStoreDumb
5857
from .test_storage import TestDBMStoreGnu as _TestDBMStoreGnu
5958
from .test_storage import TestDBMStoreNDBM as _TestDBMStoreNDBM
@@ -465,15 +464,6 @@ def create_store(self, **kwargs):
465464
return store # pragma: no cover
466465

467466

468-
class TestDBMStoreV3BerkeleyDB(_TestDBMStoreBerkeleyDB, StoreV3Tests):
469-
def create_store(self, **kwargs):
470-
bsddb3 = pytest.importorskip("bsddb3")
471-
path = mktemp(suffix=".dbm")
472-
atexit.register(os.remove, path)
473-
store = DBMStoreV3(path, flag="n", open=bsddb3.btopen, write_lock=False, **kwargs)
474-
return store
475-
476-
477467
class TestLMDBStoreV3(_TestLMDBStore, StoreV3Tests):
478468
def create_store(self, **kwargs):
479469
pytest.importorskip("lmdb")

0 commit comments

Comments
 (0)