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

Bump botocore dependency specification #1292

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Changes
-------

2.20.0 (2025-02-13)
2.20.0 (2025-02-19)
^^^^^^^^^^^^^^^^^^^
* patch `AwsChunkedWrapper.read`
* bump botocore dependency specification

2.19.0 (2025-01-22)
^^^^^^^^^^^^^^^^^^^
Expand Down
14 changes: 12 additions & 2 deletions aiobotocore/httpchecksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
FlexibleChecksumError,
_apply_request_header_checksum,
base64,
conditionally_calculate_md5,
determine_content_length,
logger,
)
Expand Down Expand Up @@ -129,7 +130,7 @@ async def handle_checksum_body(
response["context"]["checksum"] = checksum_context
return

logger.info(
logger.debug(
f'Skipping checksum validation. Response did not contain one of the '
f'following algorithms: {algorithms}.'
)
Expand Down Expand Up @@ -169,7 +170,10 @@ def apply_request_checksum(request):
if not algorithm:
return

if algorithm["in"] == "header":
if algorithm == "conditional-md5":
# Special case to handle the http checksum required trait
conditionally_calculate_md5(request)
elif algorithm["in"] == "header":
_apply_request_header_checksum(request)
elif algorithm["in"] == "trailer":
_apply_request_trailer_checksum(request)
Expand Down Expand Up @@ -213,6 +217,12 @@ def _apply_request_trailer_checksum(request):
# services such as S3 may require the decoded content length
headers["X-Amz-Decoded-Content-Length"] = str(content_length)

if "Content-Length" in headers:
del headers["Content-Length"]
logger.debug(
"Removing the Content-Length header since 'chunked' is specified for Transfer-Encoding."
)

if isinstance(body, (bytes, bytearray)):
body = io.BytesIO(body)

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dynamic = ["version", "readme"]
dependencies = [
"aiohttp >= 3.9.2, < 4.0.0",
"aioitertools >= 0.5.1, < 1.0.0",
"botocore >= 1.36.0, < 1.36.4", # NOTE: When updating, always keep `project.optional-dependencies` aligned
"botocore >= 1.36.20, < 1.36.24", # NOTE: When updating, always keep `project.optional-dependencies` aligned
"python-dateutil >= 2.1, < 3.0.0",
"jmespath >= 0.7.1, < 2.0.0",
"multidict >= 6.0.0, < 7.0.0",
Expand All @@ -43,10 +43,10 @@ dependencies = [

[project.optional-dependencies]
awscli = [
"awscli >= 1.37.0, < 1.37.4",
"awscli >= 1.37.20, < 1.37.24",
]
boto3 = [
"boto3 >= 1.36.0, < 1.36.4",
"boto3 >= 1.36.20, < 1.36.24",
]

[project.urls]
Expand Down
14 changes: 0 additions & 14 deletions tests/boto_tests/unit/test_eventstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
EventStreamHeaderParser,
EventStreamMessage,
InvalidHeadersLength,
InvalidPayloadLength,
MessagePrelude,
NoInitialResponseError,
)
Expand Down Expand Up @@ -262,17 +261,6 @@
InvalidHeadersLength,
)

# In contrast to the CORRUPTED_PAYLOAD case, this message is otherwise
# well-formed - the checksums match.
INVALID_PAYLOAD_LENGTH = (
b"\x01\x00\x00\x11" # total length
+ b"\x00\x00\x00\x00" # headers length
+ b"\xf4\x08\x61\xc5" # prelude crc
+ b"0" * (16 * 1024**2 + 1) # payload
+ b"\x2a\xb4\xc5\xa5", # message crc
InvalidPayloadLength,
)

# Tuples of encoded messages and their expected exception
NEGATIVE_CASES = [
CORRUPTED_LENGTH,
Expand All @@ -281,7 +269,6 @@
CORRUPTED_HEADER_LENGTH,
DUPLICATE_HEADER,
INVALID_HEADERS_LENGTH,
INVALID_PAYLOAD_LENGTH,
]


Expand Down Expand Up @@ -349,7 +336,6 @@ def test_all_positive_cases():
"corrupted-headers-length",
"duplicate-headers",
"invalid-headers-length",
"invalid-payload-length",
],
)
def test_negative_cases(encoded, exception):
Expand Down
7 changes: 3 additions & 4 deletions tests/test_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,7 @@
AWSResponse.text: {'a724100ba9f6d51b333b8fe470fac46376d5044a'},
# httpchecksum.py
handle_checksum_body: {
'898cee7a7a5e5a02af7e0e65dcbb8122257b85df',
'6f15cc120818413e89aac088d130c729ba3d422c',
'040cb48d8ebfb5ca195d41deb55b38d1fcb489f8',
},
_handle_streaming_response: {
'7ce971e012f9d4b04889f0af83f67281ed6a9e6e',
Expand All @@ -718,10 +717,10 @@
},
AwsChunkedWrapper.__iter__: {'261e26d1061655555fe3dcb2689d963e43f80fb0'},
apply_request_checksum: {
'94f2d201a07a3831fd55d8ca2f2d75cdb06a9514',
'6d904d118cd9d768935e38a60a73a46c67a8d440',
},
_apply_request_trailer_checksum: {
'28cdf19282be7cd2c99a734831ec4f489648bcc7'
'45f483dd8520bf67616a063bdf6386865aad3591',
},
# retryhandler.py
retryhandler.create_retry_handler: {
Expand Down
24 changes: 12 additions & 12 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading