Skip to content

Commit

Permalink
Make botocore an optional test dependency (#2768)
Browse files Browse the repository at this point in the history
* Make botocore an optional test dependency

* Add release notes
  • Loading branch information
dstansby authored Jan 28, 2025
1 parent fb37ff0 commit b5016c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/2768.bugfix.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated the optional test dependencies to include ``botocore`` and ``fsspec``.
2 changes: 2 additions & 0 deletions changes/2768.bugfix.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed the fsspec tests to skip if ``botocore`` is not installed.
Previously they would have failed with an import error.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ test = [
"coverage",
"pytest",
"pytest-cov",
'zarr[remote]',
"botocore",
"s3fs",
"moto[s3,server]",
"pytest-asyncio",
"pytest-accept",
"moto[s3,server]",
"requests",
"rich",
"mypy",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_store/test_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import TYPE_CHECKING

import pytest
from botocore.session import Session
from packaging.version import parse as parse_version

import zarr.api.asynchronous
Expand All @@ -26,6 +25,7 @@
requests = pytest.importorskip("requests")
moto_server = pytest.importorskip("moto.moto_server.threaded_moto_server")
moto = pytest.importorskip("moto")
botocore = pytest.importorskip("botocore")

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

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


Expand Down

0 comments on commit b5016c0

Please sign in to comment.