Skip to content
Open
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
8 changes: 8 additions & 0 deletions changes/3698.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
`zarr.storage.ObjectStore` now accepts any object implementing the async
[obspec](https://developmentseed.org/obspec/) protocols, rather than only instances of
`obstore` store classes. The check is structural, so wrappers around an obstore store
(a cache, a request logger) can be used directly. Exceptions raised by the underlying
store are matched by obspec's well-known names, so a store that raises its own
`NotFoundError`, `NotSupportedError` or `AlreadyExistsError` gets the same handling as
obstore. The minimum supported `obstore` version is now 0.7.0 and the `remote` extra
also installs `obspec`.
2 changes: 1 addition & 1 deletion docs/user-guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pip install zarr
There are a number of optional dependency groups you can install for extra functionality.
These can be installed using `pip install "zarr[<extra>]"`, e.g. `pip install "zarr[gpu]"`

- `remote`: support for reading/writing to remote data stores (fsspec, obstore)
- `remote`: support for reading/writing to remote data stores (fsspec, obstore, obspec)
- `gpu`: support for GPUs (cupy)
- `cli`: support for the `zarr` [command-line interface](cli.md) (typer)
- `optional`: support for path-like access to local and remote stores (universal-pathlib)
Expand Down
11 changes: 8 additions & 3 deletions docs/user-guide/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,14 @@ print(array)

### Object Store

[`zarr.storage.ObjectStore`][] stores the contents of the Zarr hierarchy using any ObjectStore
[storage implementation](https://developmentseed.org/obstore/latest/api/store/), including AWS S3 ([`obstore.store.S3Store`][]), Google Cloud Storage ([`obstore.store.GCSStore`][]), and Azure Blob Storage ([`obstore.store.AzureStore`][]). This store is backed by [obstore](https://developmentseed.org/obstore/latest/), which
builds on the production quality Rust library [object_store](https://docs.rs/object_store/latest/object_store/).
[`zarr.storage.ObjectStore`][] stores the contents of the Zarr hierarchy using any object store
that implements the async [obspec](https://developmentseed.org/obspec/latest/) protocols. The
[obstore](https://developmentseed.org/obstore/latest/) stores are the usual choice: they cover AWS S3
([`obstore.store.S3Store`][]), Google Cloud Storage ([`obstore.store.GCSStore`][]) and Azure Blob Storage
([`obstore.store.AzureStore`][]), and build on the production quality Rust library
[object_store](https://docs.rs/object_store/latest/object_store/). Because the requirement is structural
(the store only has to provide the obspec methods, not inherit from anything), middleware that wraps a
store, such as a cache or a request logger, works just as well.

```python exec="true" session="storage" source="above" result="ansi"
from zarr.storage import ObjectStore
Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ keywords = ["Python", "compressed", "ndimensional-arrays", "zarr"]
# User-facing extras (shipped in package metadata)
remote = [
"fsspec>=2023.10.0",
"obstore>=0.5.1",
"obstore>=0.7.0",
"obspec>=0.1.0",
]
gpu = [
"cupy-cuda12x; sys_platform != 'darwin'",
Expand Down Expand Up @@ -124,7 +125,8 @@ test = [
remote-tests = [
{include-group = "test"},
"fsspec>=2023.10.0",
"obstore>=0.5.1",
"obstore>=0.7.0",
"obspec>=0.1.0",
"botocore",
"s3fs>=2023.10.0",
"moto[s3,server]==5.2.3",
Expand Down Expand Up @@ -257,6 +259,7 @@ extra-dependencies = [
'typing_extensions @ git+https://github.com/python/typing_extensions',
'donfig @ git+https://github.com/pytroll/donfig',
'obstore @ git+https://github.com/developmentseed/obstore@main#subdirectory=obstore',
'obspec @ git+https://github.com/developmentseed/obspec@main',
]

[tool.hatch.envs.upstream.env-vars]
Expand All @@ -282,7 +285,8 @@ extra-dependencies = [
'universal_pathlib==0.2.0',
'typing_extensions==4.14.*',
'donfig==0.8.*',
'obstore==0.5.*',
'obstore==0.7.*',
'obspec==0.1.*',
'msgspec==0.19.*',
]

Expand Down
1 change: 1 addition & 0 deletions src/zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def print_packages(packages: list[str]) -> None:
"gcsfs",
"universal-pathlib",
"obstore",
"obspec",
]

print(f"platform: {platform.platform()}")
Expand Down
Loading
Loading