Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newer versions of smart_open #167

Merged
merged 10 commits into from
Oct 6, 2021
Merged

Support newer versions of smart_open #167

merged 10 commits into from
Oct 6, 2021

Conversation

cwegrzyn
Copy link
Contributor

@cwegrzyn cwegrzyn commented Sep 28, 2021

Widen the dependency on smart_open and gracefully handle breaking changes to S3 support in newer versions

session=self._boto3_session)
if SMART_OPEN_USE_SESSION:
return s3_open(bucket_id=self.bucket,
key_id=self.key,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

if SMART_OPEN_USE_SESSION:
return s3_open(bucket_id=self.bucket,
key_id=self.key,
mode=mode,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

return s3_open(bucket_id=self.bucket,
key_id=self.key,
mode=mode,
session=self._boto3_session)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

session=self._boto3_session)
else:
return s3_open(bucket_id=self.bucket,
key_id=self.key,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

else:
return s3_open(bucket_id=self.bucket,
key_id=self.key,
mode=mode,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

return s3_open(bucket_id=self.bucket,
key_id=self.key,
mode=mode,
client=self._boto3_session.client('s3'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

setup.py Outdated
@@ -163,11 +163,11 @@ def initialize_options(self) -> None:
# somewhere between much longer and forever to provide its output
# without this line.
#
'rsa>=3.1.4,<=4.5.0',
#'rsa>=3.1.4,<=4.5.0',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E265 block comment should start with '# '

@@ -8,10 +8,14 @@ def setUp(self):
self.mock_S3Url = Mock(name='S3Url')
self.mock_boto3_session = Mock(name='boto3_session')
self.s3_file_url = S3FileUrl('s3://bucket/topdir/bottomdir/file',
S3Url=self.mock_S3Url,
boto3_session=self.mock_boto3_session)
S3Url=self.mock_S3Url,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent

S3Url=self.mock_S3Url,
boto3_session=self.mock_boto3_session)
S3Url=self.mock_S3Url,
boto3_session=self.mock_boto3_session)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent

self.mock_s3_resource = self.mock_boto3_session.resource.return_value
self.mock_s3_client = self.mock_boto3_session.client.return_value
if SMART_OPEN_USE_SESSION:
self.open_boto_args = { "session": self.mock_boto3_session }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E201 whitespace after '{'

self.mock_s3_resource = self.mock_boto3_session.resource.return_value
self.mock_s3_client = self.mock_boto3_session.client.return_value
if SMART_OPEN_USE_SESSION:
self.open_boto_args = { "session": self.mock_boto3_session }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E202 whitespace before '}'

if SMART_OPEN_USE_SESSION:
self.open_boto_args = { "session": self.mock_boto3_session }
else:
self.open_boto_args = { "client": self.mock_s3_client }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E201 whitespace after '{'

if SMART_OPEN_USE_SESSION:
self.open_boto_args = { "session": self.mock_boto3_session }
else:
self.open_boto_args = { "client": self.mock_s3_client }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E202 whitespace before '}'

@cwegrzyn cwegrzyn marked this pull request as ready for review October 6, 2021 16:27
@cwegrzyn cwegrzyn merged commit 4ecf18d into master Oct 6, 2021
@cwegrzyn cwegrzyn deleted the smart-open-bump branch October 6, 2021 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants