Skip to content

Commit b5016c0

Browse files
authored
Make botocore an optional test dependency (#2768)
* Make botocore an optional test dependency * Add release notes
1 parent fb37ff0 commit b5016c0

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

changes/2768.bugfix.1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated the optional test dependencies to include ``botocore`` and ``fsspec``.

changes/2768.bugfix.2.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed the fsspec tests to skip if ``botocore`` is not installed.
2+
Previously they would have failed with an import error.

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ test = [
7373
"coverage",
7474
"pytest",
7575
"pytest-cov",
76+
'zarr[remote]',
77+
"botocore",
7678
"s3fs",
79+
"moto[s3,server]",
7780
"pytest-asyncio",
7881
"pytest-accept",
79-
"moto[s3,server]",
8082
"requests",
8183
"rich",
8284
"mypy",

tests/test_store/test_fsspec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import TYPE_CHECKING
66

77
import pytest
8-
from botocore.session import Session
98
from packaging.version import parse as parse_version
109

1110
import zarr.api.asynchronous
@@ -26,6 +25,7 @@
2625
requests = pytest.importorskip("requests")
2726
moto_server = pytest.importorskip("moto.moto_server.threaded_moto_server")
2827
moto = pytest.importorskip("moto")
28+
botocore = pytest.importorskip("botocore")
2929

3030
# ### amended from s3fs ### #
3131
test_bucket_name = "test"
@@ -52,7 +52,7 @@ def s3_base() -> Generator[None, None, None]:
5252

5353
def get_boto3_client() -> botocore.client.BaseClient:
5454
# NB: we use the sync botocore client for setup
55-
session = Session()
55+
session = botocore.session.Session()
5656
return session.create_client("s3", endpoint_url=endpoint_url)
5757

5858

0 commit comments

Comments
 (0)