From cc93f312b4740bcf4f9b5d8555d1361f922440e8 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 8 Dec 2024 11:00:46 +0000 Subject: [PATCH 1/7] Exclude bad version of numcodecs Actually exclude bad version of numcodecs Fix changelog entry --- docs/release.rst | 3 +++ pyproject.toml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 74207d92d1..861fd54621 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -36,6 +36,9 @@ Maintenance ``zarr-python`` if you can install it, but to reduce our maintenance burden we will no longer run our compatibility tests for it. By :user:`David Stansby ` (:issue:`2344`). +* Excluded version 0.14.0 of numcodecs, due to a bug in the implementation of + the Delta filter (see https://github.com/zarr-developers/numcodecs/issues/653 for more information). + By :user:`David Stansby ` (:issue:`2544`). Deprecations ~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index c5ff73a102..36a9492c52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ 'asciitree', 'numpy>=1.24', 'fasteners; sys_platform != "emscripten"', - 'numcodecs>=0.10.0', + 'numcodecs>=0.10.0,!=0.14.0', ] dynamic = ["version"] classifiers = [ @@ -42,7 +42,7 @@ docs = [ 'sphinx-copybutton', 'pydata-sphinx-theme', 'numpydoc', - 'numcodecs[msgpack]', + 'numcodecs[msgpack]!=0.14.0', ] [project.urls] From b55446db586d55874fb9231c6068955291ccaffc Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 8 Dec 2024 13:09:02 +0000 Subject: [PATCH 2/7] Add pytest-doctestplus doc dep Fix doctest requires Try bumping version of pytest-doctestplus Fixup doctest requires --- docs/tutorial.rst | 2 +- pyproject.toml | 1 + requirements_dev_optional.txt | 2 +- zarr/storage.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 87c4a20103..b94cf3fa1c 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -809,7 +809,7 @@ Another storage alternative is the :class:`zarr.storage.DBMStore` class, added in Zarr version 2.2. This class allows any DBM-style database to be used for storing an array or group. Here is an example using a Berkeley DB B-tree database for storage (requires `bsddb3 -`_ to be installed):: +`_ to be installed): .. doctest-requires:: bsddb3 diff --git a/pyproject.toml b/pyproject.toml index 36a9492c52..c9a929d7e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ docs = [ 'pydata-sphinx-theme', 'numpydoc', 'numcodecs[msgpack]!=0.14.0', + 'pytest-doctestplus', ] [project.urls] diff --git a/requirements_dev_optional.txt b/requirements_dev_optional.txt index df1d4fd793..a2d23a7841 100644 --- a/requirements_dev_optional.txt +++ b/requirements_dev_optional.txt @@ -15,7 +15,7 @@ pymongo==4.10.1 # optional test requirements coverage pytest-cov==5.0.0 -pytest-doctestplus==1.2.1 +pytest-doctestplus==1.3.0 pytest-timeout==2.3.1 h5py==3.12.1 fsspec==2023.12.2 diff --git a/zarr/storage.py b/zarr/storage.py index 7e5e966bc1..2c6bb16c08 100644 --- a/zarr/storage.py +++ b/zarr/storage.py @@ -2067,7 +2067,7 @@ class DBMStore(Store): A different database library can be used by passing a different function to the `open` parameter. For example, if the `bsddb3 `_ package is installed, a - Berkeley DB database can be used:: + Berkeley DB database can be used: .. doctest-requires:: bsddb3 From 3d3a92f599603c4b9bfde7dfb4dd9b9643286709 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 8 Dec 2024 13:14:43 +0000 Subject: [PATCH 3/7] Exclude other bad version of numcodecs --- docs/release.rst | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 861fd54621..b764f03a3c 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -36,7 +36,7 @@ Maintenance ``zarr-python`` if you can install it, but to reduce our maintenance burden we will no longer run our compatibility tests for it. By :user:`David Stansby ` (:issue:`2344`). -* Excluded version 0.14.0 of numcodecs, due to a bug in the implementation of +* Excluded versions 0.14.0 and 0.14.1 of numcodecs, due to a bug in the implementation of the Delta filter (see https://github.com/zarr-developers/numcodecs/issues/653 for more information). By :user:`David Stansby ` (:issue:`2544`). diff --git a/pyproject.toml b/pyproject.toml index c9a929d7e5..05afb1c41b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ 'asciitree', 'numpy>=1.24', 'fasteners; sys_platform != "emscripten"', - 'numcodecs>=0.10.0,!=0.14.0', + 'numcodecs>=0.10.0,!=0.14.0,!=0.14.1', ] dynamic = ["version"] classifiers = [ @@ -42,7 +42,7 @@ docs = [ 'sphinx-copybutton', 'pydata-sphinx-theme', 'numpydoc', - 'numcodecs[msgpack]!=0.14.0', + 'numcodecs[msgpack]!=0.14.0,!=0.14.1', 'pytest-doctestplus', ] From 9eaf470938b24b8ba63da6a1ba9213ef98df0aee Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 8 Dec 2024 13:19:25 +0000 Subject: [PATCH 4/7] Add pytest doctestplus extension --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 136fcf32d6..f900a74520 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,6 +44,7 @@ "sphinx_issues", "sphinx_copybutton", "sphinx_design", + "pytest_doctestplus.sphinx.doctestplus", ] numpydoc_show_class_members = False From e52e1a347c1524113b23639a7a75e1d2a7f7eb1b Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 8 Dec 2024 14:30:48 +0000 Subject: [PATCH 5/7] Fix skipping in docstring --- zarr/storage.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/zarr/storage.py b/zarr/storage.py index 2c6bb16c08..5d48892611 100644 --- a/zarr/storage.py +++ b/zarr/storage.py @@ -2067,15 +2067,13 @@ class DBMStore(Store): A different database library can be used by passing a different function to the `open` parameter. For example, if the `bsddb3 `_ package is installed, a - Berkeley DB database can be used: + Berkeley DB database can be used:: - .. doctest-requires:: bsddb3 - - >>> import bsddb3 - >>> store = zarr.DBMStore('data/array.bdb', open=bsddb3.btopen) - >>> z = zarr.zeros((10, 10), chunks=(5, 5), store=store, overwrite=True) - >>> z[...] = 42 - >>> store.close() + >>> import bsddb3 # doctest: +SKIP + >>> store = zarr.DBMStore('data/array.bdb', open=bsddb3.btopen) # doctest: +SKIP + >>> z = zarr.zeros((10, 10), chunks=(5, 5), store=store, overwrite=True) # doctest: +SKIP + >>> z[...] = 42 # doctest: +SKIP + >>> store.close() # doctest: +SKIP Notes ----- From daa032aa190576f95a3202ea9064c08990cc33e7 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 9 Dec 2024 11:59:41 +0000 Subject: [PATCH 6/7] Remove bsddb3 tests --- zarr/tests/test_core.py | 31 ------------------------------- zarr/tests/test_hierarchy.py | 21 --------------------- zarr/tests/test_storage.py | 9 --------- zarr/tests/test_storage_v3.py | 10 ---------- 4 files changed, 71 deletions(-) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index 4729dc01b6..3eb0fa71c8 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -1,5 +1,4 @@ import atexit -import os import sys import pickle import shutil @@ -75,7 +74,6 @@ from zarr.util import buffer_size from zarr.tests.util import ( abs_container, - have_bsddb3, have_fsspec, have_lmdb, have_sqlite3, @@ -2046,20 +2044,6 @@ def test_nbytes_stored(self): pass # not implemented -@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3") -class TestArrayWithDBMStoreBerkeleyDB(TestArray): - def create_store(self): - import bsddb3 - - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStore(path, flag="n", open=bsddb3.btopen) - return store - - def test_nbytes_stored(self): - pass # not implemented - - @pytest.mark.skipif(have_lmdb is False, reason="needs lmdb") class TestArrayWithLMDBStore(TestArray): def create_store(self): @@ -2767,21 +2751,6 @@ def test_nbytes_stored(self): pass # not implemented -@pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") -@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3") -class TestArrayWithDBMStoreV3BerkeleyDB(TestArrayV3): - def create_store(self) -> DBMStoreV3: - import bsddb3 - - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStoreV3(path, flag="n", open=bsddb3.btopen) - return store - - def test_nbytes_stored(self): - pass # not implemented - - @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") @pytest.mark.skipif(have_lmdb is False, reason="needs lmdb") class TestArrayWithLMDBStoreV3(TestArrayV3): diff --git a/zarr/tests/test_hierarchy.py b/zarr/tests/test_hierarchy.py index 161e1eb813..8a03616637 100644 --- a/zarr/tests/test_hierarchy.py +++ b/zarr/tests/test_hierarchy.py @@ -1439,27 +1439,6 @@ def create_store(): return store, None -class TestGroupWithDBMStoreBerkeleyDB(TestGroup): - @staticmethod - def create_store(): - bsddb3 = pytest.importorskip("bsddb3") - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStore(path, flag="n", open=bsddb3.btopen) - return store, None - - -@pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") -class TestGroupV3WithDBMStoreBerkeleyDB(TestGroupWithDBMStoreBerkeleyDB, TestGroupV3): - @staticmethod - def create_store(): - bsddb3 = pytest.importorskip("bsddb3") - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStoreV3(path, flag="n", open=bsddb3.btopen) - return store, None - - class TestGroupWithLMDBStore(TestGroup): @staticmethod def create_store(): diff --git a/zarr/tests/test_storage.py b/zarr/tests/test_storage.py index da690f5959..d72718d77a 100644 --- a/zarr/tests/test_storage.py +++ b/zarr/tests/test_storage.py @@ -1932,15 +1932,6 @@ def create_store(self, **kwargs): return store # pragma: no cover -class TestDBMStoreBerkeleyDB(TestDBMStore): - def create_store(self, **kwargs): - bsddb3 = pytest.importorskip("bsddb3") - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStore(path, flag="n", open=bsddb3.btopen, write_lock=False, **kwargs) - return store - - class TestLMDBStore(StoreTests): def create_store(self, **kwargs): pytest.importorskip("lmdb") diff --git a/zarr/tests/test_storage_v3.py b/zarr/tests/test_storage_v3.py index e8675786e0..47e19d911b 100644 --- a/zarr/tests/test_storage_v3.py +++ b/zarr/tests/test_storage_v3.py @@ -53,7 +53,6 @@ from .test_storage import TestABSStore as _TestABSStore from .test_storage import TestConsolidatedMetadataStore as _TestConsolidatedMetadataStore from .test_storage import TestDBMStore as _TestDBMStore -from .test_storage import TestDBMStoreBerkeleyDB as _TestDBMStoreBerkeleyDB from .test_storage import TestDBMStoreDumb as _TestDBMStoreDumb from .test_storage import TestDBMStoreGnu as _TestDBMStoreGnu from .test_storage import TestDBMStoreNDBM as _TestDBMStoreNDBM @@ -465,15 +464,6 @@ def create_store(self, **kwargs): return store # pragma: no cover -class TestDBMStoreV3BerkeleyDB(_TestDBMStoreBerkeleyDB, StoreV3Tests): - def create_store(self, **kwargs): - bsddb3 = pytest.importorskip("bsddb3") - path = mktemp(suffix=".dbm") - atexit.register(os.remove, path) - store = DBMStoreV3(path, flag="n", open=bsddb3.btopen, write_lock=False, **kwargs) - return store - - class TestLMDBStoreV3(_TestLMDBStore, StoreV3Tests): def create_store(self, **kwargs): pytest.importorskip("lmdb") From 0c641d6e58a04c4a7e6794f0ce4f9546e553cd2c Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 9 Dec 2024 14:23:16 +0000 Subject: [PATCH 7/7] Pin max version of numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 05afb1c41b..9776de7bf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ maintainers = [{ name = "Alistair Miles", email = "alimanfoo@googlemail.com" }] requires-python = ">=3.11" dependencies = [ 'asciitree', - 'numpy>=1.24', + 'numpy>=1.24,<2.2', 'fasteners; sys_platform != "emscripten"', 'numcodecs>=0.10.0,!=0.14.0,!=0.14.1', ]