Skip to content

Commit

Permalink
chore: update s3 session for smart_open >= 5
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
justindujardin committed Jun 26, 2021
1 parent 5505db3 commit e3102db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ client library prefers.

# CLI

Pathy command line interface. (v0.5.1)
Pathy command line interface. (v0.5.2)

**Usage**:

Expand Down
7 changes: 5 additions & 2 deletions pathy/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit e3102db

Please sign in to comment.