diff --git a/docs/release.rst b/docs/release.rst index 0b6775c4a6..7f424c00e2 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -18,10 +18,32 @@ Release notes See `GH1777 `_ for more details on the upcoming 3.0 release. +.. release_3.0.0-beta: + +3.0.0-beta series +----------------- + +.. warning:: + Zarr-Python 3.0.0-beta is a pre-release of the upcoming 3.0 release. This release is not feature complete or + expected to be ready for production applications. + +.. note:: + The complete release notes for 3.0 have not been added to this document yet. See the + `3.0.0-beta `_ release on GitHub + for a record of changes included in this release. + +Dependency Changes +~~~~~~~~~~~~~~~~~~ + +* fsspec was moved from a required dependency to an optional one. Users should install + fsspec and any relevant implementations (e.g. s3fs) before using the ``RemoteStore``. + By :user:`Joe Hamman ` :issue:`2391`. + + .. release_3.0.0-alpha: -3.0.0-alpha ------------ +3.0.0-alpha series +------------------ .. warning:: Zarr-Python 3.0.0-alpha is a pre-release of the upcoming 3.0 release. This release is not feature complete or diff --git a/pyproject.toml b/pyproject.toml index 888d0e0eb4..5f2d7569b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,8 +28,7 @@ requires-python = ">=3.11" dependencies = [ 'numpy>=1.25', 'numcodecs[crc32c]>=0.14', - 'fsspec>=2022.10.0', - 'typing_extensions>=4.6', + 'typing_extensions>=4.9', 'donfig>=0.8', ] @@ -54,16 +53,16 @@ license = {text = "MIT License"} keywords = ["Python", "compressed", "ndimensional-arrays", "zarr"] [project.optional-dependencies] +fsspec = [ + "fsspec>=2023.10.0", +] test = [ "coverage", "pytest", "pytest-cov", - "msgpack", "s3fs", "pytest-asyncio", "moto[s3]", - "flask-cors", - "flask", "requests", "mypy", "hypothesis", @@ -224,7 +223,7 @@ dependencies = [ 'fsspec==2022.10.0', 's3fs==2022.10.0', 'universal_pathlib==0.0.22', - 'typing_extensions==4.6.*', # 4.5 needed for @deprecated, 4.6 for Buffer + 'typing_extensions==4.9.*', 'donfig==0.8.*', # test deps 'hypothesis', diff --git a/tests/test_store/test_core.py b/tests/test_store/test_core.py index 4d3f305e53..81ed3744a9 100644 --- a/tests/test_store/test_core.py +++ b/tests/test_store/test_core.py @@ -3,7 +3,6 @@ import pytest from _pytest.compat import LEGACY_PATH -from upath import UPath from zarr.core.common import AccessModeLiteral from zarr.storage._utils import normalize_path @@ -72,6 +71,7 @@ async def test_make_store_path_invalid() -> None: async def test_make_store_path_fsspec(monkeypatch) -> None: + pytest.importorskip("fsspec") store_path = await make_store_path("http://foo.com/bar") assert isinstance(store_path.store, RemoteStore) @@ -106,13 +106,17 @@ async def test_unsupported() -> None: "foo/bar///", Path("foo/bar"), b"foo/bar", - UPath("foo/bar"), ], ) -def test_normalize_path_valid(path: str | bytes | Path | UPath) -> None: +def test_normalize_path_valid(path: str | bytes | Path) -> None: assert normalize_path(path) == "foo/bar" +def test_normalize_path_upath() -> None: + upath = pytest.importorskip("upath") + assert normalize_path(upath.UPath("foo/bar")) == "foo/bar" + + def test_normalize_path_none(): assert normalize_path(None) == "" diff --git a/tests/test_store/test_remote.py b/tests/test_store/test_remote.py index aee620796c..c7f33e4b39 100644 --- a/tests/test_store/test_remote.py +++ b/tests/test_store/test_remote.py @@ -4,10 +4,8 @@ import os from typing import TYPE_CHECKING -import fsspec import pytest from botocore.session import Session -from upath import UPath import zarr.api.asynchronous from zarr.core.buffer import Buffer, cpu, default_buffer_prototype @@ -21,6 +19,7 @@ import botocore.client +fsspec = pytest.importorskip("fsspec") s3fs = pytest.importorskip("s3fs") requests = pytest.importorskip("requests") moto_server = pytest.importorskip("moto.moto_server.threaded_moto_server") @@ -182,7 +181,8 @@ async def test_remote_store_from_uri(self, store: RemoteStore): assert dict(group.attrs) == {"key": "value-3"} def test_from_upath(self) -> None: - path = UPath( + upath = pytest.importorskip("upath") + path = upath.UPath( f"s3://{test_bucket_name}/foo/bar/", endpoint_url=endpoint_url, anon=False,