From f50296cbedf830560751bff6afdde97563b981cc Mon Sep 17 00:00:00 2001 From: Sanket Verma Date: Wed, 27 Dec 2023 23:15:15 +0530 Subject: [PATCH 01/14] Update release.rst --- docs/release.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index c18e0b8c20..3f3d125910 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -45,6 +45,9 @@ Docs * Minor tweak to advanced indexing tutorial examples. By :user:`Ross Barnowski ` :issue:`1550`. +* Automatically document array members using sphinx-automodapi. + By :user:`David Stansby ` :issue:`1547`. + Maintenance ~~~~~~~~~~~ @@ -70,6 +73,26 @@ Maintenance * Remove ``sphinx-rtd-theme`` dependency from ``pyproject.toml``. By :user:`Sanket Verma ` :issue:`1563`. +* Remove ``CODE_OF_CONDUCT.md`` file from the Zarr-Python repository. + By :user:`Sanket Verma ` :issue:`1572`. + +* Bump version of black in pre-commit. + By :user:`David Stansby ` :issue:`1559`. + +* Use list comprehension where applicable. + By :user:`Dimitri Papadopoulos Orfanos ` :issue:`1555`. + +* Use format specification mini-language to format string. + By :user:`Dimitri Papadopoulos Orfanos ` :issue:`1558`. + +* Single startswith() call instead of multiple ones. + By :user:`Dimitri Papadopoulos Orfanos ` :issue:`1556`. + +* Move codespell options around. + By :user:`Dimitri Papadopoulos Orfanos ` :issue:`1196`. + +* Remove unused mypy ignore comments. + By :user:`David Stansby ` :issue:`1602`. .. _release_2.16.1: From aaf5a30f04f1b01fe28f2644ddbbd3904c165b7a Mon Sep 17 00:00:00 2001 From: Sanket Verma Date: Wed, 24 Jan 2024 04:36:17 +0530 Subject: [PATCH 02/14] Update release.rst --- docs/release.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index 3f3d125910..4935460b54 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -18,6 +18,11 @@ Release notes Unreleased ---------- +.. _release_2.16.2: + +2.16.2 +------ + Enhancements ~~~~~~~~~~~~ @@ -48,6 +53,14 @@ Docs * Automatically document array members using sphinx-automodapi. By :user:`David Stansby ` :issue:`1547`. +* Add a markdown file documenting the current and former core-developer team. + By :user:`Joe Hamman ` :issue:`1628`. + +* Add Norman Rzepka to core-dev team. + By :user:`Joe Hamman ` :issue:`1630`. + +* Add V3 roadmap and design document. + By :user:`Joe Hamman ` :issue:`1583`. Maintenance ~~~~~~~~~~~ From e28e1c98b275a81f3484b93b62888df1c399ffb7 Mon Sep 17 00:00:00 2001 From: Sanket Verma Date: Mon, 29 Jan 2024 21:47:12 +0530 Subject: [PATCH 03/14] =?UTF-8?q?Change=202.16.2=20=E2=86=92=202.17.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/release.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 454bb16acb..6db6dc3f18 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -18,9 +18,9 @@ Release notes Unreleased ---------- -.. _release_2.16.2: +.. _release_2.17.0: -2.16.2 +2.17.0 ------ Enhancements From 6a70b3044926dc6d64fc956bb2601f6ceeccee61 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Mon, 5 Feb 2024 20:14:21 +0100 Subject: [PATCH 04/14] Update moto for test_s3 --- requirements_dev_optional.txt | 2 +- zarr/tests/test_storage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements_dev_optional.txt b/requirements_dev_optional.txt index b4de5fd515..d1ee5a891d 100644 --- a/requirements_dev_optional.txt +++ b/requirements_dev_optional.txt @@ -20,4 +20,4 @@ pytest-timeout==2.2.0 h5py==3.10.0 fsspec==2023.12.2 s3fs==2023.12.2 -moto[server]>=4.0.8 +moto[server]>=5.0.1 diff --git a/zarr/tests/test_storage.py b/zarr/tests/test_storage.py index 25863749d8..e4e3d93f5f 100644 --- a/zarr/tests/test_storage.py +++ b/zarr/tests/test_storage.py @@ -1396,7 +1396,7 @@ def s3(request): port = 5555 endpoint_uri = "http://127.0.0.1:%d/" % port proc = subprocess.Popen( - shlex.split("moto_server s3 -p %d" % port), + shlex.split("moto_server -p %d" % port), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, ) From 6ff474e30e99237907d5d0c605813624803e97c7 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Mon, 5 Feb 2024 21:57:05 +0100 Subject: [PATCH 05/14] Skip bsddb3 tests to prevent warning failure --- zarr/tests/test_core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index a3fde4050d..e26ac37d49 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2039,6 +2039,11 @@ def test_nbytes_stored(self): class TestArrayWithDBMStoreBerkeleyDB(TestArray): + + def __init__(self): + # Skip warning tests as well + bsddb3 = pytest.importorskip("bsddb3") + def create_store(self): bsddb3 = pytest.importorskip("bsddb3") path = mktemp(suffix=".dbm") From 37e6e1fb516707bf01c15fe3f3bc2f9062e4c061 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Mon, 5 Feb 2024 22:02:35 +0100 Subject: [PATCH 06/14] Fix more user warning tests --- zarr/tests/test_core.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index e26ac37d49..d85c0f6895 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2039,10 +2039,9 @@ def test_nbytes_stored(self): class TestArrayWithDBMStoreBerkeleyDB(TestArray): - def __init__(self): # Skip warning tests as well - bsddb3 = pytest.importorskip("bsddb3") + pytest.importorskip("bsddb3") def create_store(self): bsddb3 = pytest.importorskip("bsddb3") @@ -2056,6 +2055,10 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStore(TestArray): + def __init__(self): + # Skip warning tests as well + pytest.importorskip("lmdb") + def create_store(self): pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") @@ -2071,6 +2074,10 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStoreNoBuffers(TestArray): + def __init__(self): + # Skip warning tests as well + pytest.importorskip("lmdb") + def create_store(self): pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") @@ -2083,6 +2090,10 @@ def test_nbytes_stored(self): class TestArrayWithSQLiteStore(TestArray): + def __init__(self): + # Skip warning tests as well + pytest.importorskip("sqlite3") + def create_store(self): pytest.importorskip("sqlite3") path = mktemp(suffix=".db") From 4f7b7b21c453a7e17bc603058f0f7e45af329239 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Mon, 5 Feb 2024 22:06:34 +0100 Subject: [PATCH 07/14] Fix even more user warning tests --- zarr/tests/test_core.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index d85c0f6895..ac4aff7eab 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2775,6 +2775,10 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") class TestArrayWithDBMStoreV3BerkeleyDB(TestArrayV3): + def __init__(self): + # Skip warning tests as well + pytest.importorskip("bsddb3") + def create_store(self) -> DBMStoreV3: bsddb3 = pytest.importorskip("bsddb3") path = mktemp(suffix=".dbm") @@ -2790,6 +2794,10 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStoreV3(TestArrayV3): lmdb_buffers = True + def __init__(self): + # Skip warning tests as well + pytest.importorskip("lmdb") + def create_store(self) -> LMDBStoreV3: pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") @@ -2814,6 +2822,10 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") class TestArrayWithSQLiteStoreV3(TestArrayV3): + def __init__(self): + # Skip warning tests as well + pytest.importorskip("sqlite3") + def create_store(self): pytest.importorskip("sqlite3") path = mktemp(suffix=".db") From bfa1db4cb9555bf253caf4c4207ad55e37308dbe Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Mon, 5 Feb 2024 22:57:23 +0100 Subject: [PATCH 08/14] Skip coverage for importorskips --- zarr/tests/test_core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index ac4aff7eab..85f55b7a15 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2039,7 +2039,7 @@ def test_nbytes_stored(self): class TestArrayWithDBMStoreBerkeleyDB(TestArray): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("bsddb3") @@ -2055,7 +2055,7 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStore(TestArray): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("lmdb") @@ -2074,7 +2074,7 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStoreNoBuffers(TestArray): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("lmdb") @@ -2090,7 +2090,7 @@ def test_nbytes_stored(self): class TestArrayWithSQLiteStore(TestArray): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("sqlite3") @@ -2775,7 +2775,7 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") class TestArrayWithDBMStoreV3BerkeleyDB(TestArrayV3): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("bsddb3") @@ -2794,7 +2794,7 @@ def test_nbytes_stored(self): class TestArrayWithLMDBStoreV3(TestArrayV3): lmdb_buffers = True - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("lmdb") @@ -2822,7 +2822,7 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") class TestArrayWithSQLiteStoreV3(TestArrayV3): - def __init__(self): + def __init__(self): # pragma: no cover # Skip warning tests as well pytest.importorskip("sqlite3") From 195b447d9be108642e52f671012cbaf2de65bde6 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 14 Feb 2024 13:18:12 +0100 Subject: [PATCH 09/14] Move to have_X skip method for deps --- zarr/tests/test_core.py | 53 +++++++++++++---------------------------- zarr/tests/util.py | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index 85f55b7a15..7dec1cc224 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -73,7 +73,14 @@ ) from zarr.tests.test_storage_v3 import DummyStorageTransfomer from zarr.util import buffer_size -from zarr.tests.util import abs_container, skip_test_env_var, have_fsspec, mktemp +from zarr.tests.util import ( + abs_container, + have_bsddb3, + have_lmdb, + have_sqlite3, + mktemp, + skip_test_env_var, +) from zarr.types import DIMENSION_SEPARATOR # noinspection PyMethodMayBeStatic @@ -2018,7 +2025,7 @@ def expected(self): ] -@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec") +@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3") class TestArrayWithN5FSStore(TestArrayWithN5Store): def create_store(self): path = mkdtemp() @@ -2038,13 +2045,9 @@ def test_nbytes_stored(self): pass # not implemented +@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3") class TestArrayWithDBMStoreBerkeleyDB(TestArray): - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("bsddb3") - def create_store(self): - bsddb3 = pytest.importorskip("bsddb3") path = mktemp(suffix=".dbm") atexit.register(os.remove, path) store = DBMStore(path, flag="n", open=bsddb3.btopen) @@ -2054,13 +2057,9 @@ def test_nbytes_stored(self): pass # not implemented +@pytest.mark.skipif(have_lmdb is False, reason="needs lmdb") class TestArrayWithLMDBStore(TestArray): - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("lmdb") - def create_store(self): - pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") atexit.register(atexit_rmtree, path) store = LMDBStore(path, buffers=True) @@ -2073,13 +2072,9 @@ def test_nbytes_stored(self): pass # not implemented +@pytest.mark.skipif(have_lmdb is False, reason="needs lmdb") class TestArrayWithLMDBStoreNoBuffers(TestArray): - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("lmdb") - def create_store(self): - pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") atexit.register(atexit_rmtree, path) store = LMDBStore(path, buffers=False) @@ -2089,13 +2084,9 @@ def test_nbytes_stored(self): pass # not implemented +@pytest.mark.skipif(have_sqlite3 is False, reason="needs sqlite3") class TestArrayWithSQLiteStore(TestArray): - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("sqlite3") - def create_store(self): - pytest.importorskip("sqlite3") path = mktemp(suffix=".db") atexit.register(atexit_rmtree, path) store = SQLiteStore(path) @@ -2774,13 +2765,9 @@ def test_nbytes_stored(self): @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 __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("bsddb3") - def create_store(self) -> DBMStoreV3: - bsddb3 = pytest.importorskip("bsddb3") path = mktemp(suffix=".dbm") atexit.register(os.remove, path) store = DBMStoreV3(path, flag="n", open=bsddb3.btopen) @@ -2791,15 +2778,11 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") +@pytest.mark.skipif(have_lmdb is False, reason="needs lmdb") class TestArrayWithLMDBStoreV3(TestArrayV3): lmdb_buffers = True - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("lmdb") - def create_store(self) -> LMDBStoreV3: - pytest.importorskip("lmdb") path = mktemp(suffix=".lmdb") atexit.register(atexit_rmtree, path) store = LMDBStoreV3(path, buffers=self.lmdb_buffers) @@ -2821,13 +2804,9 @@ def test_nbytes_stored(self): @pytest.mark.skipif(not v3_api_available, reason="V3 is disabled") +@pytest.mark.skipif(have_sqlite3 is False, reason="needs sqlite3") class TestArrayWithSQLiteStoreV3(TestArrayV3): - def __init__(self): # pragma: no cover - # Skip warning tests as well - pytest.importorskip("sqlite3") - def create_store(self): - pytest.importorskip("sqlite3") path = mktemp(suffix=".db") atexit.register(atexit_rmtree, path) store = SQLiteStoreV3(path) diff --git a/zarr/tests/util.py b/zarr/tests/util.py index b4f00f703d..b3c3249cab 100644 --- a/zarr/tests/util.py +++ b/zarr/tests/util.py @@ -69,6 +69,30 @@ def skip_test_env_var(name): have_fsspec = False +try: + import bsddb3 # noqa: F401 + + have_bsddb3 = True +except ImportError: # pragma: no cover + have_bsddb3 = False + + +try: + import lmdb # noqa: F401 + + have_lmdb = True +except ImportError: # pragma: no cover + have_lmdb = False + + +try: + import sqlite3 # noqa: F401 + + have_sqlite3 = True +except ImportError: # pragma: no cover + have_sqlite3 = False + + def abs_container(): from azure.core.exceptions import ResourceExistsError import azure.storage.blob as asb From 3092f425b12183b74bc5a83d60d87a01ca830a69 Mon Sep 17 00:00:00 2001 From: Sanket Verma Date: Wed, 14 Feb 2024 23:57:07 +0530 Subject: [PATCH 10/14] Update release.rst (PR#1663) --- docs/release.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index 6db6dc3f18..0f199aadd2 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -29,6 +29,9 @@ Enhancements * Added type hints to ``zarr.creation.create()``. By :user:`David Stansby ` :issue:`1536`. +* Pyodide support: Don't require fasteners on Emscripten. + By :user:`Hood Chatham ` :issue:`1663`. + Docs ~~~~ From 1e756c6d5a14b46c8ac84876e4541c2c970b2cc6 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 14 Feb 2024 20:05:13 +0100 Subject: [PATCH 11/14] Fix test_core.py 'compile' issues --- zarr/tests/test_core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index 7dec1cc224..096ef77107 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -76,6 +76,7 @@ from zarr.tests.util import ( abs_container, have_bsddb3, + have_fsspec, have_lmdb, have_sqlite3, mktemp, @@ -2048,6 +2049,7 @@ def test_nbytes_stored(self): @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) @@ -2768,6 +2770,7 @@ def test_nbytes_stored(self): @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) From af91f8df188b12ed569c673a3c922e825c7a2055 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 14 Feb 2024 20:24:19 +0100 Subject: [PATCH 12/14] Add black formatting --- zarr/tests/test_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index 096ef77107..96bf61a9bf 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2050,6 +2050,7 @@ def test_nbytes_stored(self): 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) @@ -2771,6 +2772,7 @@ def test_nbytes_stored(self): 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) From f375f953b0cd89c13decf7e9ac085c7585dfe21d Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 14 Feb 2024 20:27:31 +0100 Subject: [PATCH 13/14] Drop Windows/3.9 build due to unrelated failures --- .github/workflows/windows-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-testing.yml b/.github/workflows/windows-testing.yml index 5c3252c0ba..0ef7f21758 100644 --- a/.github/workflows/windows-testing.yml +++ b/.github/workflows/windows-testing.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: True matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.10', '3.11'] steps: - uses: actions/checkout@v4 with: From 06f903d77694e85973a332a05afdcce74349ba08 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 14 Feb 2024 20:56:51 +0100 Subject: [PATCH 14/14] fix typo --- zarr/tests/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zarr/tests/test_core.py b/zarr/tests/test_core.py index 96bf61a9bf..cf15703497 100644 --- a/zarr/tests/test_core.py +++ b/zarr/tests/test_core.py @@ -2026,7 +2026,7 @@ def expected(self): ] -@pytest.mark.skipif(have_bsddb3 is False, reason="needs bsddb3") +@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec") class TestArrayWithN5FSStore(TestArrayWithN5Store): def create_store(self): path = mkdtemp()