Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
ZARR_TEST_ABS: 1
ZARR_TEST_MONGO: 1
ZARR_TEST_REDIS: 1
ZARR_V3_API_AVAILABLE: 1
run: |
conda activate zarr-env
mkdir ~/blob_emulator
Expand Down
6 changes: 6 additions & 0 deletions zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from zarr.errors import CopyError, MetadataError
from zarr.hierarchy import Group, group, open_group
from zarr.n5 import N5Store, N5FSStore
from zarr._storage.store import v3_api_available
from zarr.storage import (ABSStore, DBMStore, DictStore, DirectoryStore,
KVStore, LMDBStore, LRUStoreCache, MemoryStore, MongoDBStore,
NestedDirectoryStore, RedisStore, SQLiteStore,
Expand All @@ -19,3 +20,8 @@

# in case setuptools scm screw up and find version to be 0.0.0
assert not __version__.startswith("0.0.0")

if v3_api_available:
from zarr._storage.v3 import (ABSStoreV3, DBMStoreV3, KVStoreV3, DirectoryStoreV3,
LMDBStoreV3, LRUStoreCacheV3, MemoryStoreV3, MongoDBStoreV3,
RedisStoreV3, SQLiteStoreV3, ZipStoreV3)
5 changes: 4 additions & 1 deletion zarr/_storage/store.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
import os
from collections.abc import MutableMapping
from string import ascii_letters, digits
from typing import Any, List, Mapping, Optional, Union
Expand All @@ -17,6 +18,8 @@

DEFAULT_ZARR_VERSION = 2

v3_api_available = os.environ.get('ZARR_V3_API_AVAILABLE', '0').lower() not in ['0', 'false']


class BaseStore(MutableMapping):
"""Abstract base class for store implementations.
Expand Down Expand Up @@ -261,7 +264,7 @@ def _ensure_store(store):

We'll do this conversion in a few places automatically
"""
from zarr.storage import KVStoreV3 # avoid circular import
from zarr._storage.v3 import KVStoreV3 # avoid circular import
if store is None:
return None
elif isinstance(store, StoreV3):
Expand Down
Loading