Skip to content

Commit 368b170

Browse files
d-v-bDahnJmaxrjonesjhammanSaransh-cpp
authored
Remove old v3 (#1742)
* chore: add deprecation warnings to v3 classes / functions * Resolve Mypy erorrs in `v3` branch (#1692) * refactor(v3): Using appropriate types * fix(v3): Typing fixes + minor code fixes * fix(v3): _sync_iter works with coroutines * docs(v3/store/core.py): clearer comment * fix(metadata.py): Use Any outside TYPE_CHECKING for Pydantic * fix(zarr/v3): correct zarr format + remove unused method * fix(v3/store/core.py): Potential suggestion on handling str store_like * refactor(zarr/v3): Add more typing * ci(.pre-commit-config.yaml): zarr v3 mypy checks turned on in pre-commit * Specify hatch envs using GitHub actions matrix for v3 tests (#1728) * Specify v3 hatch envs using GitHub actions matrix * Update .github/workflows/test-v3.yml Co-authored-by: Joe Hamman <[email protected]> * Update .github/workflows/test-v3.yml Co-authored-by: Joe Hamman <[email protected]> * test on 3.12 too * no 3.12 --------- Co-authored-by: Joe Hamman <[email protected]> Co-authored-by: Joe Hamman <[email protected]> * black -> ruff format + cleanup (#1639) * black -> ruff + cleanup * format * Preserve git blame * pre-commit fix * Remove outdated dev install docs from installation.rst and link to contributing.rst (#1643) Co-authored-by: Joe Hamman <[email protected]> * chore: remove old v3 implementation * chore: remove more version-conditional logic * chore: remove v3_storage_transformers.py again --------- Co-authored-by: Daniel Jahn (dahn) <[email protected]> Co-authored-by: Max Jones <[email protected]> Co-authored-by: Joe Hamman <[email protected]> Co-authored-by: Joe Hamman <[email protected]> Co-authored-by: Saransh Chopra <[email protected]> Co-authored-by: Alden Keefe Sampson <[email protected]>
1 parent 472ab13 commit 368b170

20 files changed

+424
-4413
lines changed

src/zarr/__init__.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from zarr.errors import CopyError, MetadataError
3232
from zarr.hierarchy import Group, group, open_group
3333
from zarr.n5 import N5Store, N5FSStore
34-
from zarr._storage.store import v3_api_available
3534
from zarr.storage import (
3635
ABSStore,
3736
DBMStore,
@@ -53,18 +52,3 @@
5352

5453
# in case setuptools scm screw up and find version to be 0.0.0
5554
assert not __version__.startswith("0.0.0")
56-
57-
if v3_api_available:
58-
from zarr._storage.v3 import (
59-
ABSStoreV3,
60-
DBMStoreV3,
61-
KVStoreV3,
62-
DirectoryStoreV3,
63-
LMDBStoreV3,
64-
LRUStoreCacheV3,
65-
MemoryStoreV3,
66-
MongoDBStoreV3,
67-
RedisStoreV3,
68-
SQLiteStoreV3,
69-
ZipStoreV3,
70-
)

src/zarr/_storage/absstore.py

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import warnings
44
from numcodecs.compat import ensure_bytes
55
from zarr.util import normalize_storage_path
6-
from zarr._storage.store import _get_metadata_suffix, data_root, meta_root, Store, StoreV3
6+
from zarr._storage.store import Store
77

88
__doctest_requires__ = {
99
("ABSStore", "ABSStore.*"): ["azure.storage.blob"],
@@ -222,56 +222,3 @@ def getsize(self, path=None):
222222

223223
def clear(self):
224224
self.rmdir()
225-
226-
227-
class ABSStoreV3(ABSStore, StoreV3):
228-
def list(self):
229-
return list(self.keys())
230-
231-
def __eq__(self, other):
232-
return (
233-
isinstance(other, ABSStoreV3)
234-
and self.client == other.client
235-
and self.prefix == other.prefix
236-
)
237-
238-
def __setitem__(self, key, value):
239-
self._validate_key(key)
240-
super().__setitem__(key, value)
241-
242-
def rmdir(self, path=None):
243-
if not path:
244-
# Currently allowing clear to delete everything as in v2
245-
246-
# If we disallow an empty path then we will need to modify
247-
# TestABSStoreV3 to have the create_store method use a prefix.
248-
ABSStore.rmdir(self, "")
249-
return
250-
251-
meta_dir = meta_root + path
252-
meta_dir = meta_dir.rstrip("/")
253-
ABSStore.rmdir(self, meta_dir)
254-
255-
# remove data folder
256-
data_dir = data_root + path
257-
data_dir = data_dir.rstrip("/")
258-
ABSStore.rmdir(self, data_dir)
259-
260-
# remove metadata files
261-
sfx = _get_metadata_suffix(self)
262-
array_meta_file = meta_dir + ".array" + sfx
263-
if array_meta_file in self:
264-
del self[array_meta_file]
265-
group_meta_file = meta_dir + ".group" + sfx
266-
if group_meta_file in self:
267-
del self[group_meta_file]
268-
269-
# TODO: adapt the v2 getsize method to work for v3
270-
# For now, calling the generic keys-based _getsize
271-
def getsize(self, path=None):
272-
from zarr.storage import _getsize # avoid circular import
273-
274-
return _getsize(self, path)
275-
276-
277-
ABSStoreV3.__doc__ = ABSStore.__doc__

0 commit comments

Comments
 (0)