From e3102db3e24f8a8d13da7551398ab5248540423a Mon Sep 17 00:00:00 2001 From: justindujardin Date: Sat, 26 Jun 2021 12:46:55 -0700 Subject: [PATCH] chore: update s3 session for smart_open >= 5 BREAKING CHANGE: This change removes support for smart_open < 5.0.0 The API for specifying s3 credentials changed in smart_open v5, so previous versions are incompatible. --- README.md | 2 +- pathy/s3.py | 7 +++++-- requirements.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a8acb08..119fe00 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,7 @@ client library prefers. # CLI -Pathy command line interface. (v0.5.1) +Pathy command line interface. (v0.5.2) **Usage**: diff --git a/pathy/s3.py b/pathy/s3.py index 1ab8e01..c6522b1 100644 --- a/pathy/s3.py +++ b/pathy/s3.py @@ -112,11 +112,14 @@ def exists(self) -> bool: class BucketClientS3(BucketClient): client: S3NativeClient - _session: Optional[Any] + _session: Optional[boto3.Session] @property def client_params(self) -> Dict[str, Any]: - return dict() if self._session is None else dict(session=self._session) + if self._session is None: + return dict() + session: Any = self._session + return dict(client=session.client("s3")) def __init__(self, **kwargs: Any) -> None: self.recreate(**kwargs) diff --git a/requirements.txt b/requirements.txt index 557fa33..a6516e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -smart-open>=2.2.0,<6.0.0 +smart-open>=5.0.0,<6.0.0 typer>=0.3.0,<1.0.0 dataclasses>=0.6,<1.0; python_version < "3.7" \ No newline at end of file