From 2d6520b64557151ba269f87d763e0a40ee1debf2 Mon Sep 17 00:00:00 2001 From: Jakob Keller <57402305+jakob-keller@users.noreply.github.com> Date: Thu, 16 May 2024 19:16:15 +0200 Subject: [PATCH] Support up-to-date `botocore` (#1115) --- CHANGES.rst | 4 ++++ aiobotocore/__init__.py | 2 +- aiobotocore/client.py | 3 +++ aiobotocore/signers.py | 13 +++++++++++-- requirements-dev.in | 6 +++--- setup.py | 6 +++--- tests/test_patches.py | 6 +++--- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 39855fcb..c0945a19 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,10 @@ Changes ------- +2.12.4 (2024-05-16) +^^^^^^^^^^^^^^^^^^^ +* bump botocore dependency specification + 2.12.3 (2024-04-11) ^^^^^^^^^^^^^^^^^^^ * relax botocore dependency specification diff --git a/aiobotocore/__init__.py b/aiobotocore/__init__.py index 2de3060d..95515d62 100644 --- a/aiobotocore/__init__.py +++ b/aiobotocore/__init__.py @@ -1 +1 @@ -__version__ = '2.12.3' +__version__ = '2.12.4' diff --git a/aiobotocore/client.py b/aiobotocore/client.py index e37e20f5..762ae520 100644 --- a/aiobotocore/client.py +++ b/aiobotocore/client.py @@ -253,6 +253,9 @@ def _register_s3_events( self._set_s3_presign_signature_version( client.meta, client_config, scoped_config ) + client.meta.events.register( + 'before-parameter-build.s3', self._inject_s3_input_parameters + ) def _get_client_args( self, diff --git a/aiobotocore/signers.py b/aiobotocore/signers.py index ac2570bd..dbabce87 100644 --- a/aiobotocore/signers.py +++ b/aiobotocore/signers.py @@ -69,6 +69,10 @@ async def sign( kwargs['region_name'] = signing_context['region'] if signing_context.get('signing_name'): kwargs['signing_name'] = signing_context['signing_name'] + if signing_context.get('request_credentials'): + kwargs['request_credentials'] = signing_context[ + 'request_credentials' + ] if signing_context.get('identity_cache') is not None: self._resolve_identity_cache( kwargs, @@ -129,7 +133,12 @@ async def _choose_signer(self, operation_name, signing_type, context): return signature_version async def get_auth_instance( - self, signing_name, region_name, signature_version=None, **kwargs + self, + signing_name, + region_name, + signature_version=None, + request_credentials=None, + **kwargs, ): if signature_version is None: signature_version = self._signature_version @@ -147,7 +156,7 @@ async def get_auth_instance( auth = cls(frozen_token) return auth - credentials = self._credentials + credentials = request_credentials or self._credentials if getattr(cls, "REQUIRES_IDENTITY_CACHE", None) is True: cache = kwargs["identity_cache"] key = kwargs["cache_key"] diff --git a/requirements-dev.in b/requirements-dev.in index d857ee22..5a122be2 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -3,10 +3,10 @@ coverage==7.2.7 docker~=6.1.3 moto[server,s3,sqs,lambda,dynamodb,cloudformation,sns,batch,ec2,rds]~=4.2.9 pre-commit~=3.5.0 -pytest==7.4.0 -pytest-cov==4.1.0 +pytest==8.1.1 +pytest-cov==5.0.0 pytest-asyncio~=0.21.1 -pytest-xdist==3.3.1 +pytest-xdist==3.5.0 setuptools==67.8.0;python_version>="3.12" # this is needed for test_patches diff --git a/setup.py b/setup.py index 00a75d28..1c8a3ad9 100644 --- a/setup.py +++ b/setup.py @@ -7,15 +7,15 @@ # NOTE: When updating botocore make sure to update awscli/boto3 versions below install_requires = [ # pegged to also match items in `extras_require` - 'botocore>=1.34.41,<1.34.70', + 'botocore>=1.34.70,<1.34.107', 'aiohttp>=3.7.4.post0,<4.0.0', 'wrapt>=1.10.10, <2.0.0', 'aioitertools>=0.5.1,<1.0.0', ] extras_require = { - 'awscli': ['awscli>=1.32.41,<1.32.70'], - 'boto3': ['boto3>=1.34.41,<1.34.70'], + 'awscli': ['awscli>=1.32.70,<1.32.107'], + 'boto3': ['boto3>=1.34.70,<1.34.107'], } diff --git a/tests/test_patches.py b/tests/test_patches.py index 570fa495..0a38cdbe 100644 --- a/tests/test_patches.py +++ b/tests/test_patches.py @@ -159,7 +159,7 @@ '716c1549989eef6bbd048bf4f134c1b4659e124a', }, ClientCreator._register_s3_events: { - '5659a5312caeb3ea97d663d837d6d201f08824f2' + '4ab15da7cb36fa795f64154581a970b0966fdf50', }, ClientCreator._register_retries: { '16d3064142e5f9e45b0094bbfabf7be30183f255' @@ -446,11 +446,11 @@ # signers.py RequestSigner.handler: {'371909df136a0964ef7469a63d25149176c2b442'}, RequestSigner.sign: { - '8b6ca96055e5546a6572ad790d5af74a23bc0b52', + '2f1f45a6fcfcca1be2c5e292c9e1b80453e7fa57', }, RequestSigner.get_auth: {'4f8099bef30f9a72fa3bcaa1bd3d22c4fbd224a8'}, RequestSigner.get_auth_instance: { - 'dcd41ea686506dcf056d8252ccf73acd501efd2b', + 'b78756b9d4f7a5bce9630195d761bab557677225', }, RequestSigner._choose_signer: {'bd0e9784029b8aa182b5aec73910d94cb67c36b0'}, RequestSigner.generate_presigned_url: {