Skip to content

Commit

Permalink
Merge branch 'release-1.34.124'
Browse files Browse the repository at this point in the history
* release-1.34.124:
  Bumping version to 1.34.124
  Add changelog entries from botocore
  Run ruff over codebase
  Add ruff setup
  • Loading branch information
aws-sdk-python-automation committed Jun 11, 2024
2 parents e7bfeb4 + dad7ebd commit e2088c5
Show file tree
Hide file tree
Showing 28 changed files with 160 additions and 154 deletions.
27 changes: 27 additions & 0 deletions .changes/1.34.124.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"category": "``accessanalyzer``",
"description": "[``botocore``] IAM Access Analyzer now provides policy recommendations to help resolve unused permissions for IAM roles and users. Additionally, IAM Access Analyzer now extends its custom policy checks to detect when IAM policies grant public access or access to critical resources ahead of deployments.",
"type": "api-change"
},
{
"category": "``guardduty``",
"description": "[``botocore``] Added API support for GuardDuty Malware Protection for S3.",
"type": "api-change"
},
{
"category": "``networkmanager``",
"description": "[``botocore``] This is model changes & documentation update for Service Insertion feature for AWS Cloud WAN. This feature allows insertion of AWS/3rd party security services on Cloud WAN. This allows to steer inter/intra segment traffic via security appliances and provide visibility to the route updates.",
"type": "api-change"
},
{
"category": "``pca-connector-scep``",
"description": "[``botocore``] Connector for SCEP allows you to use a managed, cloud CA to enroll mobile devices and networking gear. SCEP is a widely-adopted protocol used by mobile device management (MDM) solutions for enrolling mobile devices. With the connector, you can use AWS Private CA with popular MDM solutions.",
"type": "api-change"
},
{
"category": "``sagemaker``",
"description": "[``botocore``] Introduced Scope and AuthenticationRequestExtraParams to SageMaker Workforce OIDC configuration; this allows customers to modify these options for their private Workforce IdP integration. Model Registry Cross-account model package groups are discoverable.",
"type": "api-change"
}
]
22 changes: 5 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,9 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: 'https://github.com/asottile/pyupgrade'
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
hooks:
- id: pyupgrade
args:
- '--py38-plus'
- repo: 'https://github.com/PyCQA/isort'
rev: 5.12.0
hooks:
- id: isort
- repo: 'https://github.com/psf/black'
rev: 23.11.0
hooks:
- id: black
- repo: 'https://github.com/pycqa/flake8'
rev: 6.1.0
hooks:
- id: flake8
- id: ruff
args: [ --fix ]
- id: ruff-format
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
CHANGELOG
=========

1.34.124
========

* api-change:``accessanalyzer``: [``botocore``] IAM Access Analyzer now provides policy recommendations to help resolve unused permissions for IAM roles and users. Additionally, IAM Access Analyzer now extends its custom policy checks to detect when IAM policies grant public access or access to critical resources ahead of deployments.
* api-change:``guardduty``: [``botocore``] Added API support for GuardDuty Malware Protection for S3.
* api-change:``networkmanager``: [``botocore``] This is model changes & documentation update for Service Insertion feature for AWS Cloud WAN. This feature allows insertion of AWS/3rd party security services on Cloud WAN. This allows to steer inter/intra segment traffic via security appliances and provide visibility to the route updates.
* api-change:``pca-connector-scep``: [``botocore``] Connector for SCEP allows you to use a managed, cloud CA to enroll mobile devices and networking gear. SCEP is a widely-adopted protocol used by mobile device management (MDM) solutions for enrolling mobile devices. With the connector, you can use AWS Private CA with popular MDM solutions.
* api-change:``sagemaker``: [``botocore``] Introduced Scope and AuthenticationRequestExtraParams to SageMaker Workforce OIDC configuration; this allows customers to modify these options for their private Workforce IdP integration. Model Registry Cross-account model package groups are discoverable.


1.34.123
========

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.34.123'
__version__ = '1.34.124'


# The default Boto3 session; autoloaded when needed.
Expand Down
15 changes: 6 additions & 9 deletions boto3/docs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def document_action(
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
example_resource_name = resource_name
example_prefix = '{} = {}.{}'.format(
example_return_value, example_resource_name, action_model.name
example_prefix = (
f'{example_return_value} = {example_resource_name}.{action_model.name}'
)
full_action_name = (
f"{section.context.get('qualifier', '')}{action_model.name}"
Expand Down Expand Up @@ -193,13 +193,10 @@ def document_load_reload_action(
It is useful for generating docstrings.
"""
description = (
'Calls :py:meth:`{}.Client.{}` to update the attributes of the '
'{} resource. Note that the load and reload methods are '
'the same method and can be used interchangeably.'.format(
get_service_module_name(service_model),
xform_name(load_model.request.operation),
resource_name,
)
f'Calls :py:meth:`{get_service_module_name(service_model)}.Client.'
f'{xform_name(load_model.request.operation)}` to update the attributes of the '
f'{resource_name} resource. Note that the load and reload methods are '
'the same method and can be used interchangeably.'
)
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
Expand Down
6 changes: 1 addition & 5 deletions boto3/docs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ def _add_client_creation_example(self, section):
section.write('import boto3')
section.style.new_line()
section.style.new_line()
section.write(
'client = boto3.client(\'{service}\')'.format(
service=self._service_name
)
)
section.write(f'client = boto3.client(\'{self._service_name}\')')
section.style.end_codeblock()
31 changes: 5 additions & 26 deletions boto3/docs/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ def document_batch_action(
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
example_resource_name = resource_name
example_prefix = '{} = {}.{}.{}'.format(
example_return_value,
example_resource_name,
collection_model.name,
batch_action_model.name,
)
example_prefix = f'{example_return_value} = {example_resource_name}.{collection_model.name}.{batch_action_model.name}'
document_model_driven_resource_method(
section=section,
method_name=batch_action_model.name,
Expand Down Expand Up @@ -229,11 +224,7 @@ def document_collection_method(
f'Creates an iterable of all {collection_model.resource.type} '
f'resources in the collection.'
),
'example_prefix': '{}_iterator = {}.{}.all'.format(
xform_name(collection_model.resource.type),
example_resource_name,
collection_model.name,
),
'example_prefix': f'{xform_name(collection_model.resource.type)}_iterator = {example_resource_name}.{collection_model.name}.all',
'exclude_input': underlying_operation_members,
},
'filter': {
Expand All @@ -245,11 +236,7 @@ def document_collection_method(
f'and extreme caution should be taken when performing actions '
f'on all resources.'
),
'example_prefix': '{}_iterator = {}.{}.filter'.format(
xform_name(collection_model.resource.type),
example_resource_name,
collection_model.name,
),
'example_prefix': f'{xform_name(collection_model.resource.type)}_iterator = {example_resource_name}.{collection_model.name}.filter',
'exclude_input': get_resource_ignore_params(
collection_model.request.params
),
Expand All @@ -259,11 +246,7 @@ def document_collection_method(
f'Creates an iterable up to a specified amount of '
f'{collection_model.resource.type} resources in the collection.'
),
'example_prefix': '{}_iterator = {}.{}.limit'.format(
xform_name(collection_model.resource.type),
example_resource_name,
collection_model.name,
),
'example_prefix': f'{xform_name(collection_model.resource.type)}_iterator = {example_resource_name}.{collection_model.name}.limit',
'include_input': [
DocumentedShape(
name='count',
Expand All @@ -282,11 +265,7 @@ def document_collection_method(
f'resources in the collection, but limits the number of '
f'items returned by each service call by the specified amount.'
),
'example_prefix': '{}_iterator = {}.{}.page_size'.format(
xform_name(collection_model.resource.type),
example_resource_name,
collection_model.name,
),
'example_prefix': f'{xform_name(collection_model.resource.type)}_iterator = {example_resource_name}.{collection_model.name}.page_size',
'include_input': [
DocumentedShape(
name='count',
Expand Down
4 changes: 2 additions & 2 deletions boto3/docs/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def document_model_driven_resource_method(
resource_type = resource_action_model.resource.type

new_return_section = section.add_new_section('return')
return_resource_type = '{}.{}'.format(
operation_model.service_model.service_name, resource_type
return_resource_type = (
f'{operation_model.service_model.service_name}.{resource_type}'
)

return_type = f':py:class:`{return_resource_type}`'
Expand Down
15 changes: 3 additions & 12 deletions boto3/docs/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ def _add_intro(self, section):
def _add_description(self, section):
official_service_name = get_official_service_name(self._service_model)
section.write(
'A resource representing an {} {}'.format(
official_service_name, self._resource_name
)
f'A resource representing an {official_service_name} {self._resource_name}'
)

def _add_example(self, section, identifier_names):
Expand All @@ -103,19 +101,12 @@ def _add_example(self, section, identifier_names):
section.style.new_line()
section.style.new_line()
section.write(
'{} = boto3.resource(\'{}\')'.format(
self._service_name, self._service_name
)
f'{self._service_name} = boto3.resource(\'{self._service_name}\')'
)
section.style.new_line()
example_values = get_identifier_values_for_example(identifier_names)
section.write(
'{} = {}.{}({})'.format(
xform_name(self._resource_name),
self._service_name,
self._resource_name,
example_values,
)
f'{xform_name(self._resource_name)} = {self._service_name}.{self._resource_name}({example_values})'
)
section.style.end_codeblock()

Expand Down
12 changes: 2 additions & 10 deletions boto3/docs/subresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,7 @@ def document_sub_resource(
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
example_resource_name = resource_name
example = '{} = {}.{}({})'.format(
xform_name(sub_resource_model.resource.type),
example_resource_name,
sub_resource_model.name,
example_values,
)
example = f'{xform_name(sub_resource_model.resource.type)} = {example_resource_name}.{sub_resource_model.name}({example_values})'
example_section.style.start_codeblock()
example_section.write(example)
example_section.style.end_codeblock()
Expand All @@ -141,10 +136,7 @@ def document_sub_resource(
return_section = section.add_new_section('return')
return_section.style.new_line()
return_section.write(
':rtype: :py:class:`{}.{}`'.format(
get_service_module_name(service_model),
sub_resource_model.resource.type,
)
f':rtype: :py:class:`{get_service_module_name(service_model)}.{sub_resource_model.resource.type}`'
)
return_section.style.new_line()
return_section.write(
Expand Down
4 changes: 2 additions & 2 deletions boto3/docs/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def document_resource_waiter(
waiter_model.max_attempts,
)
)
example_prefix = '{}.{}'.format(
xform_name(resource_name), resource_waiter_model.name
example_prefix = (
f'{xform_name(resource_name)}.{resource_waiter_model.name}'
)
full_waiter_name = (
f"{section.context.get('qualifier', '')}{resource_waiter_model.name}"
Expand Down
4 changes: 1 addition & 3 deletions boto3/resources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def __init__(
self.resource_model = resource_model

def __repr__(self):
return 'ResourceMeta(\'{}\', identifiers={})'.format(
self.service_name, self.identifiers
)
return f'ResourceMeta(\'{self.service_name}\', identifiers={self.identifiers})'

def __eq__(self, other):
# Two metas are equal if their components are all equal
Expand Down
18 changes: 6 additions & 12 deletions boto3/resources/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def __repr__(self):
return '{}({}, {})'.format(
self.__class__.__name__,
self._parent,
'{}.{}'.format(
self._parent.meta.service_name, self._model.resource.type
),
f'{self._parent.meta.service_name}.{self._model.resource.type}',
)

def __iter__(self):
Expand Down Expand Up @@ -154,7 +152,7 @@ def pages(self):
paginator = client.get_paginator(self._py_operation_name)
pages = paginator.paginate(
PaginationConfig={'MaxItems': limit, 'PageSize': page_size},
**params
**params,
)
else:
logger.debug(
Expand Down Expand Up @@ -327,9 +325,7 @@ def __repr__(self):
return '{}({}, {})'.format(
self.__class__.__name__,
self._parent,
'{}.{}'.format(
self._parent.meta.service_name, self._model.resource.type
),
f'{self._parent.meta.service_name}.{self._model.resource.type}',
)

def iterator(self, **kwargs):
Expand Down Expand Up @@ -424,13 +420,11 @@ def load_from_definition(
)

if service_context.service_name == resource_name:
cls_name = '{}.{}Collection'.format(
service_context.service_name, collection_name
cls_name = (
f'{service_context.service_name}.{collection_name}Collection'
)
else:
cls_name = '{}.{}.{}Collection'.format(
service_context.service_name, resource_name, collection_name
)
cls_name = f'{service_context.service_name}.{resource_name}.{collection_name}Collection'

collection_cls = type(str(cls_name), (ResourceCollection,), attrs)

Expand Down
4 changes: 1 addition & 3 deletions boto3/resources/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,7 @@ def _load_name_with_category(self, names, name, category, snake_case=True):
# This isn't good, let's raise instead of trying to keep
# renaming this value.
raise ValueError(
'Problem renaming {} {} to {}!'.format(
self.name, category, name
)
f'Problem renaming {self.name} {category} to {name}!'
)

names.add(name)
Expand Down
4 changes: 1 addition & 3 deletions boto3/resources/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ def build_empty_response(search_path, operation_name, service_model):
shape = shape.member
else:
raise NotImplementedError(
'Search path hits shape type {} from {}'.format(
shape.type_name, item
)
f'Search path hits shape type {shape.type_name} from {item}'
)

# Anything not handled here is set to None
Expand Down
1 change: 1 addition & 0 deletions boto3/s3/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def __call__(self, bytes_amount):
"""

import logging
import threading
from os import PathLike, fspath, getpid
Expand Down
4 changes: 1 addition & 3 deletions boto3/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def __init__(

# Setup custom user-agent string if it isn't already customized
if self._session.user_agent_name == 'Botocore':
botocore_info = 'Botocore/{}'.format(
self._session.user_agent_version
)
botocore_info = f'Botocore/{self._session.user_agent_version}'
if self._session.user_agent_extra:
self._session.user_agent_extra += ' ' + botocore_info
else:
Expand Down
Loading

0 comments on commit e2088c5

Please sign in to comment.