Skip to content

Commit 7450ad0

Browse files
committed
Deprecate v3 code in v2 branch
1 parent fb01742 commit 7450ad0

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

docs/release.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Unreleased
2323
Deprecations
2424
~~~~~~~~~~~~
2525

26+
* Deprecated ``zarr._storage.v3`` and ``zarr._storage.v3_storage_transformers``.
27+
This functionality and will be removed in ``zarr-python`` 2.19.0.
28+
For Zarr format 3 support, use the v3 release of ``zarr-python``.
29+
By :user:`David Stansby <dstansby>`
2630
* Deprecated support for ``partial_decompress`` when creating an array.
2731
This functionality is no longer supported in ``numcodecs``, and will be removed
2832
in ``zarr-python`` 2.19.0.

zarr/_storage/v3.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import warnings
2+
3+
14
import os
25
import shutil
36
from collections import OrderedDict
@@ -49,6 +52,14 @@
4952
_getsize,
5053
)
5154

55+
warnings.warn(
56+
"zarr._storage.v3 is deprecated, and will be removed in zarr-python 2.19.0. "
57+
"Use zarr-python 3 instead for Zarr format 3 support.",
58+
DeprecationWarning,
59+
stacklevel=2,
60+
)
61+
62+
5263
__doctest_requires__ = {
5364
("RedisStore", "RedisStore.*"): ["redis"],
5465
("MongoDBStore", "MongoDBStore.*"): ["pymongo"],

zarr/_storage/v3_storage_transformers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import itertools
33
import os
44
from typing import NamedTuple, Tuple, Optional, Union, Iterator
5+
import warnings
56

67
from numcodecs.compat import ensure_bytes
78
import numpy as np
@@ -11,6 +12,14 @@
1112
from zarr.types import DIMENSION_SEPARATOR
1213

1314

15+
warnings.warn(
16+
"zarr._storage.v3 is deprecated, and will be removed in zarr-python 2.19.0. "
17+
"Use zarr-python 3 instead for Zarr format 3 support.",
18+
DeprecationWarning,
19+
stacklevel=2,
20+
)
21+
22+
1423
MAX_UINT_64 = 2**64 - 1
1524

1625

zarr/tests/test_storage_v3.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@
6767
from .test_storage import dimension_separator_fixture, s3, skip_if_nested_chunks # noqa
6868

6969

70-
pytestmark = pytest.mark.skipif(not v3_api_available, reason="v3 api is not available")
70+
pytestmark = [
71+
pytest.mark.skipif(not v3_api_available, reason="v3 api is not available"),
72+
pytest.mark.filterwarnings("ignore:zarr.*v3 is deprecated:DeprecationWarning"),
73+
]
7174

7275

7376
@pytest.fixture(

0 commit comments

Comments
 (0)