Skip to content

Commit

Permalink
bump to 1.27.59 (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehesiod authored Aug 25, 2022
1 parent 9233555 commit fbfeb12
Show file tree
Hide file tree
Showing 22 changed files with 537 additions and 479 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changes
-------
2.4.0 (2022-08-25)
^^^^^^^^^^^^^^^^^^
* bump botocore to 1.27.59

2.3.4 (2022-06-23)
^^^^^^^^^^^^^^^^^^
* fix select_object_content
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ flake8-isort = "== 4.1.1"
black = "== 22.6.0"
isort = "== 5.10.1"
docker = '==5.0.0'
moto = {extras = ["server","s3","sqs","lambda","dynamodb","cloudformation", "sns", "batch", "ec2", "rds"],version = "~=2.2.19"}
moto = {extras = ["server","s3","sqs","lambda","dynamodb","cloudformation", "sns", "batch", "ec2", "rds"],version = "~=4.0.0"}
pytest = "==6.2.4"
pytest-cov = "==2.11.1"
pytest-asyncio = "==0.14.0"
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.4'
__version__ = '2.4.0'
94 changes: 46 additions & 48 deletions aiobotocore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ async def create_client(
)
service_client = cls(**client_args)
self._register_retries(service_client)
self._register_eventbridge_events(
service_client, endpoint_bridge, endpoint_url
)
self._register_s3_events(
service_client,
endpoint_bridge,
Expand Down Expand Up @@ -103,37 +106,6 @@ async def _create_client_class(self, service_name, service_model):
cls = type(str(class_name), tuple(bases), class_attributes)
return cls

def _register_endpoint_discovery(self, client, endpoint_url, config):
if endpoint_url is not None:
# Don't register any handlers in the case of a custom endpoint url
return
# Only attach handlers if the service supports discovery
if client.meta.service_model.endpoint_discovery_operation is None:
return
events = client.meta.events
service_id = client.meta.service_model.service_id.hyphenize()
enabled = False
if config and config.endpoint_discovery_enabled is not None:
enabled = config.endpoint_discovery_enabled
elif self._config_store:
enabled = self._config_store.get_config_variable(
'endpoint_discovery_enabled'
)

enabled = self._normalize_endpoint_discovery_config(enabled)
if enabled and self._requires_endpoint_discovery(client, enabled):
discover = enabled is True
manager = AioEndpointDiscoveryManager(
client, always_discover=discover
)
handler = AioEndpointDiscoveryHandler(manager)
handler.register(events, service_id)
else:
events.register(
'before-parameter-build',
block_endpoint_discovery_required_operations,
)

def _register_retries(self, client):
# botocore retry handlers may block. We add our own implementation here.
# botocore provides three implementations:
Expand Down Expand Up @@ -206,9 +178,40 @@ def _register_legacy_retries(self, client):
)
unique_id = 'retry-config-%s' % service_event_name
client.meta.events.register(
'needs-retry.%s' % service_event_name, handler, unique_id=unique_id
f"needs-retry.{service_event_name}", handler, unique_id=unique_id
)

def _register_endpoint_discovery(self, client, endpoint_url, config):
if endpoint_url is not None:
# Don't register any handlers in the case of a custom endpoint url
return
# Only attach handlers if the service supports discovery
if client.meta.service_model.endpoint_discovery_operation is None:
return
events = client.meta.events
service_id = client.meta.service_model.service_id.hyphenize()
enabled = False
if config and config.endpoint_discovery_enabled is not None:
enabled = config.endpoint_discovery_enabled
elif self._config_store:
enabled = self._config_store.get_config_variable(
'endpoint_discovery_enabled'
)

enabled = self._normalize_endpoint_discovery_config(enabled)
if enabled and self._requires_endpoint_discovery(client, enabled):
discover = enabled is True
manager = AioEndpointDiscoveryManager(
client, always_discover=discover
)
handler = AioEndpointDiscoveryHandler(manager)
handler.register(events, service_id)
else:
events.register(
'before-parameter-build',
block_endpoint_discovery_required_operations,
)

def _register_s3_events(
self,
client,
Expand Down Expand Up @@ -290,6 +293,10 @@ def __getattr__(self, item):
)
)

async def close(self):
"""Closes underlying endpoint connections."""
await self._endpoint.close()

async def _make_api_call(self, operation_name, api_params):
operation_model = self._service_model.operation_model(operation_name)
service_name = self._service_model.service_name
Expand Down Expand Up @@ -399,20 +406,15 @@ async def _emit_api_params(self, api_params, operation_model, context):
# parameters or return a new set of parameters to use.
service_id = self._service_model.service_id.hyphenize()
responses = await self.meta.events.emit(
'provide-client-params.{service_id}.{operation_name}'.format(
service_id=service_id, operation_name=operation_name
),
f'provide-client-params.{service_id}.{operation_name}',
params=api_params,
model=operation_model,
context=context,
)
api_params = first_non_none_response(responses, default=api_params)

event_name = 'before-parameter-build.{service_id}.{operation_name}'
await self.meta.events.emit(
event_name.format(
service_id=service_id, operation_name=operation_name
),
f'before-parameter-build.{service_id}.{operation_name}',
params=api_params,
model=operation_model,
context=context,
Expand Down Expand Up @@ -462,11 +464,11 @@ def paginate(self, **kwargs):
)

# Rename the paginator class based on the type of paginator.
paginator_class_name = str(
'{}.Paginator.{}'.format(
get_service_module_name(self.meta.service_model),
actual_operation_name,
)
service_module_name = get_service_module_name(
self.meta.service_model
)
paginator_class_name = (
f"{service_module_name}.Paginator.{actual_operation_name}"
)

# Create the new paginator class
Expand Down Expand Up @@ -516,7 +518,3 @@ async def __aenter__(self):

async def __aexit__(self, exc_type, exc_val, exc_tb):
await self._endpoint.http_session.__aexit__(exc_type, exc_val, exc_tb)

async def close(self):
"""Close all http connections."""
return await self._endpoint.http_session.close()
Loading

0 comments on commit fbfeb12

Please sign in to comment.