Skip to content

Commit

Permalink
Merge branch 'release-1.26.3'
Browse files Browse the repository at this point in the history
* release-1.26.3:
  Bumping version to 1.26.3
  Add changelog entries from botocore
  Remove direct usage of six from project (#3478)
  • Loading branch information
aws-sdk-python-automation committed Nov 4, 2022
2 parents f87f945 + 07e2758 commit 929866d
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 50 deletions.
22 changes: 22 additions & 0 deletions .changes/1.26.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"category": "``ec2``",
"description": "[``botocore``] This release adds API support for the recipient of an AMI account share to remove shared AMI launch permissions.",
"type": "api-change"
},
{
"category": "``emr-containers``",
"description": "[``botocore``] Adding support for Job templates. Job templates allow you to create and store templates to configure Spark applications parameters. This helps you ensure consistent settings across applications by reusing and enforcing configuration overrides in data pipelines.",
"type": "api-change"
},
{
"category": "``logs``",
"description": "[``botocore``] Doc-only update for bug fixes and support of export to buckets encrypted with SSE-KMS",
"type": "api-change"
},
{
"category": "``endpoint-rules``",
"description": "[``botocore``] Update endpoint-rules client to latest version",
"type": "api-change"
}
]
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

1.26.3
======

* api-change:``ec2``: [``botocore``] This release adds API support for the recipient of an AMI account share to remove shared AMI launch permissions.
* api-change:``emr-containers``: [``botocore``] Adding support for Job templates. Job templates allow you to create and store templates to configure Spark applications parameters. This helps you ensure consistent settings across applications by reusing and enforcing configuration overrides in data pipelines.
* api-change:``logs``: [``botocore``] Doc-only update for bug fixes and support of export to buckets encrypted with SSE-KMS
* api-change:``endpoint-rules``: [``botocore``] Update endpoint-rules client to latest version


1.26.2
======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.26.2'
__version__ = '1.26.3'


# The default Boto3 session; autoloaded when needed.
Expand Down
19 changes: 6 additions & 13 deletions boto3/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,15 @@
import socket
import warnings

from botocore.vendored import six
from boto3.exceptions import PythonDeprecationWarning

if six.PY3:
# In python3, socket.error is OSError, which is too general
# for what we want (i.e FileNotFoundError is a subclass of OSError).
# In py3 all the socket related errors are in a newly created
# ConnectionError
SOCKET_ERROR = ConnectionError
else:
SOCKET_ERROR = socket.error
# In python3, socket.error is OSError, which is too general
# for what we want (i.e FileNotFoundError is a subclass of OSError).
# In py3 all the socket related errors are in a newly created
# ConnectionError
SOCKET_ERROR = ConnectionError

if six.PY3:
import collections.abc as collections_abc
else:
import collections as collections_abc
import collections.abc as collections_abc


if sys.platform.startswith('win'):
Expand Down
7 changes: 4 additions & 3 deletions boto3/dynamodb/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import collections.abc
from decimal import (
Clamped,
Context,
Expand All @@ -21,6 +20,8 @@
Underflow,
)

from boto3.compat import collections_abc

STRING = 'S'
NUMBER = 'N'
BINARY = 'B'
Expand Down Expand Up @@ -183,7 +184,7 @@ def _is_binary(self, value):
return False

def _is_set(self, value):
if isinstance(value, collections.abc.Set):
if isinstance(value, collections_abc.Set):
return True
return False

Expand All @@ -194,7 +195,7 @@ def _is_type_set(self, value, type_validator):
return False

def _is_map(self, value):
if isinstance(value, collections.abc.Mapping):
if isinstance(value, collections_abc.Mapping):
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore>=1.29.2,<1.30.0
botocore>=1.29.3,<1.30.0
jmespath>=0.7.1,<2.0.0
s3transfer>=0.6.0,<0.7.0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


requires = [
'botocore>=1.29.2,<1.30.0',
'botocore>=1.29.3,<1.30.0',
'jmespath>=0.7.1,<2.0.0',
's3transfer>=0.6.0,<0.7.0',
]
Expand Down
11 changes: 6 additions & 5 deletions tests/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import io

import botocore
import botocore.stub
import pytest
from botocore.compat import six
from botocore.config import Config
from botocore.stub import Stubber

Expand Down Expand Up @@ -244,7 +245,7 @@ def progress_callback(amount):
class TestUploadFileobj(BaseTransferTest):
def setUp(self):
super().setUp()
self.contents = six.BytesIO(b'foo\n')
self.contents = io.BytesIO(b'foo\n')

def stub_put_object(self):
put_object_response = {
Expand Down Expand Up @@ -330,7 +331,7 @@ def test_object_upload(self):

def test_multipart_upload(self):
chunksize = 8 * (1024**2)
contents = six.BytesIO(b'0' * (chunksize * 3))
contents = io.BytesIO(b'0' * (chunksize * 3))
self.stub_multipart_upload(num_parts=3)
transfer_config = TransferConfig(
multipart_chunksize=chunksize,
Expand All @@ -354,7 +355,7 @@ class TestDownloadFileobj(BaseTransferTest):
def setUp(self):
super().setUp()
self.contents = b'foo'
self.fileobj = six.BytesIO()
self.fileobj = io.BytesIO()

def stub_single_part_download(self):
self.stub_head(content_length=len(self.contents))
Expand Down Expand Up @@ -400,7 +401,7 @@ def stub_get_object(self, full_contents, start_byte=0, end_byte=None):
"ETag": self.etag,
"ContentLength": len(contents),
"ContentType": "binary/octet-stream",
"Body": six.BytesIO(contents),
"Body": io.BytesIO(contents),
"ResponseMetadata": {"HTTPStatusCode": 200},
}
)
Expand Down
11 changes: 5 additions & 6 deletions tests/integration/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# language governing permissions and limitations under the License.
import datetime
import hashlib
import io
import logging
import math
import os
Expand All @@ -21,13 +22,11 @@
import threading

from botocore.client import Config
from botocore.compat import six

import boto3.s3.transfer
import boto3.session
from tests import unique_id, unittest

urlopen = six.moves.urllib.request.urlopen
LOG = logging.getLogger('boto3.tests.integration')


Expand Down Expand Up @@ -338,7 +337,7 @@ def test_copy(self):
self.object_exists('bar')

def test_upload_fileobj(self):
fileobj = six.BytesIO(b'foo')
fileobj = io.BytesIO(b'foo')
self.client.upload_fileobj(
Fileobj=fileobj, Bucket=self.bucket_name, Key='foo'
)
Expand All @@ -356,7 +355,7 @@ def test_upload_fileobj_progress(self):
multipart_threshold=chunksize,
max_concurrency=1,
)
fileobj = six.BytesIO(b'0' * (chunksize * 3))
fileobj = io.BytesIO(b'0' * (chunksize * 3))

def progress_callback(amount):
self.progress += amount
Expand All @@ -374,7 +373,7 @@ def progress_callback(amount):
self.assertEqual(self.progress, chunksize * 3)

def test_download_fileobj(self):
fileobj = six.BytesIO()
fileobj = io.BytesIO()
self.client.put_object(
Bucket=self.bucket_name, Key='foo', Body=b'beach'
)
Expand Down Expand Up @@ -692,7 +691,7 @@ def test_transfer_methods_do_not_use_threads(self):
self.addCleanup(self.delete_object, key)
self.assertTrue(self.object_exists(key))

fileobj = six.BytesIO()
fileobj = io.BytesIO()
self.client.download_fileobj(
Bucket=self.bucket_name, Key='foo', Fileobj=fileobj, Config=config
)
Expand Down
30 changes: 15 additions & 15 deletions tests/unit/docs/test_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from botocore.compat import six
import io

from tests import mock
from tests.unit.docs import BaseDocsTest


class TestResourceDocstrings(BaseDocsTest):
def test_action_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.sample_operation)
action_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_action_help(self):

def test_load_help(self):
sub_resource = self.resource.Sample('Id')
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(sub_resource.load)
load_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -69,7 +69,7 @@ def test_load_help(self):
)

def test_sub_resource_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.Sample)
sub_resource_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -85,15 +85,15 @@ def test_sub_resource_help(self):
)

def test_attribute_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.Sample('id').__class__.foo)
attribute_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
[' - *(string) --* Documents Foo'], attribute_docstring
)

def test_identifier_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.Sample('id').__class__.name)
identifier_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -106,7 +106,7 @@ def test_identifier_help(self):

def test_reference_help(self):
sample_resource = self.resource.Sample('id')
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(sample_resource.__class__.related_sample)
reference_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -118,7 +118,7 @@ def test_reference_help(self):
)

def test_collection_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.__class__.samples)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -127,7 +127,7 @@ def test_collection_help(self):
)

def test_collection_all_method_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.samples.all)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -146,7 +146,7 @@ def test_collection_all_method_help(self):
)

def test_collection_filter_method_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.samples.filter)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -168,7 +168,7 @@ def test_collection_filter_method_help(self):
)

def test_collection_limit_method_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.samples.limit)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -190,7 +190,7 @@ def test_collection_limit_method_help(self):
)

def test_collection_page_size_method_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.samples.page_size)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -213,7 +213,7 @@ def test_collection_page_size_method_help(self):

def test_collection_chaining_help(self):
collection = self.resource.samples.all()
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(collection.all)
collection_method_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand All @@ -232,7 +232,7 @@ def test_collection_chaining_help(self):
)

def test_batch_action_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.samples.operate)
batch_action_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_batch_action_help(self):
)

def test_resource_waiter_help(self):
with mock.patch('sys.stdout', six.StringIO()) as mock_stdout:
with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
help(self.resource.Sample('id').wait_until_complete)
resource_waiter_docstring = mock_stdout.getvalue()
self.assert_contains_lines_in_order(
Expand Down
Loading

0 comments on commit 929866d

Please sign in to comment.