Skip to content

Commit

Permalink
Merge branch 'release-1.21.6'
Browse files Browse the repository at this point in the history
* release-1.21.6:
  Bumping version to 1.21.6
  Add changelog entries from botocore
  Update black to 22.1.0 (#3166)
  Update 3.6 deprecation notice with blog post (#3164)
  Extend linting tools (#3041)
  • Loading branch information
aws-sdk-python-automation committed Feb 23, 2022
2 parents c033e92 + eee16db commit 0095f14
Show file tree
Hide file tree
Showing 92 changed files with 4,769 additions and 3,642 deletions.
17 changes: 17 additions & 0 deletions .changes/1.21.6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"category": "``transfer``",
"description": "[``botocore``] The file input selection feature provides the ability to use either the originally uploaded file or the output file from the previous workflow step, enabling customers to make multiple copies of the original file while keeping the source file intact for file archival.",
"type": "api-change"
},
{
"category": "``lambda``",
"description": "[``botocore``] Lambda releases .NET 6 managed runtime to be available in all commercial regions.",
"type": "api-change"
},
{
"category": "``textract``",
"description": "[``botocore``] Added support for merged cells and column header for table response.",
"type": "api-change"
}
]
26 changes: 20 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
exclude: ^(.github|.changes|docs/|boto3/compat.py|boto3/data|CHANGELOG.rst)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: 'https://github.com/asottile/pyupgrade'
rev: v2.29.0
hooks:
- id: pyupgrade
args:
- '--py36-plus'
- repo: 'https://github.com/PyCQA/isort'
rev: 5.9.3
hooks:
- id: isort
- repo: 'https://github.com/psf/black'
rev: 22.1.0
hooks:
- id: black
- repo: 'https://github.com/pycqa/flake8'
rev: 3.9.2
hooks:
- id: flake8
- id: flake8
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
CHANGELOG
=========

1.21.6
======

* api-change:``transfer``: [``botocore``] The file input selection feature provides the ability to use either the originally uploaded file or the output file from the previous workflow step, enabling customers to make multiple copies of the original file while keeping the source file intact for file archival.
* api-change:``lambda``: [``botocore``] Lambda releases .NET 6 managed runtime to be available in all commercial regions.
* api-change:``textract``: [``botocore``] Added support for merged cells and column header for table response.


1.21.5
======

Expand Down
9 changes: 6 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ Boto3 is maintained and published by `Amazon Web Services`_.
Notices
-------

On 01/15/2021 deprecation for Python 2.7 was announced and support was dropped
on 07/15/2021. To avoid disruption, customers using Boto3 on Python 2.7 may
On 2021-01-15, deprecation for Python 2.7 was announced and support was dropped
on 2021-07-15. To avoid disruption, customers using Boto3 on Python 2.7 may
need to upgrade their version of Python or pin the version of Boto3. For
more information, see this `blog post <https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/>`__.

Starting in May 2022, we will be dropping support for Python 3.6. This follows the Python Software Foundation `end of support <https://www.python.org/dev/peps/pep-0494/#lifespan>`__ for the runtime which occurred on 2021-12-23.
On 2022-05-30, we will be dropping support for Python 3.6. This follows the
Python Software Foundation `end of support <https://www.python.org/dev/peps/pep-0494/#lifespan>`__
for the runtime which occurred on 2021-12-23.
For more information, see this `blog post <https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/>`__.

.. _boto: https://docs.pythonboto.org/
.. _`doc site`: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
Expand Down
5 changes: 2 additions & 3 deletions boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@

import logging

from boto3.session import Session
from boto3.compat import _warn_deprecated_python

from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.21.5'
__version__ = '1.21.6'


# The default Boto3 session; autoloaded when needed.
Expand Down
3 changes: 2 additions & 1 deletion boto3/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def generate_docs(root_dir, session):
for service_name in session.get_available_services():
docs = ServiceDocumenter(service_name, session).document_service()
service_doc_path = os.path.join(
services_doc_path, service_name + '.rst')
services_doc_path, service_name + '.rst'
)
with open(service_doc_path, 'wb') as f:
f.write(docs)
76 changes: 51 additions & 25 deletions boto3/docs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from botocore import xform_name
from botocore.docs.method import (
document_custom_method,
document_model_driven_method,
)
from botocore.model import OperationModel
from botocore.utils import get_service_module_name
from botocore.docs.method import document_model_driven_method
from botocore.docs.method import document_custom_method

from boto3.docs.base import BaseDocumenter
from boto3.docs.method import document_model_driven_resource_method
from boto3.docs.utils import get_resource_ignore_params
from boto3.docs.utils import get_resource_public_actions
from boto3.docs.utils import add_resource_type_overview
from boto3.docs.utils import (
add_resource_type_overview,
get_resource_ignore_params,
get_resource_public_actions,
)


class ActionDocumenter(BaseDocumenter):
Expand All @@ -30,16 +34,19 @@ def document_actions(self, section):
for modeled_action in modeled_actions_list:
modeled_actions[modeled_action.name] = modeled_action
resource_actions = get_resource_public_actions(
self._resource.__class__)
self._resource.__class__
)
self.member_map['actions'] = sorted(resource_actions)
add_resource_type_overview(
section=section,
resource_type='Actions',
description=(
'Actions call operations on resources. They may '
'automatically handle the passing in of arguments set '
'from identifiers and some attributes.'),
intro_link='actions_intro')
'from identifiers and some attributes.'
),
intro_link='actions_intro',
)

for action_name in sorted(resource_actions):
action_section = section.add_new_section(action_name)
Expand All @@ -50,7 +57,7 @@ def document_actions(self, section):
resource_name=self._resource_name,
event_emitter=self._resource.meta.client.meta.events,
load_model=self._resource_model.load,
service_model=self._service_model
service_model=self._service_model,
)
elif action_name in modeled_actions:
document_action(
Expand All @@ -62,11 +69,18 @@ def document_actions(self, section):
)
else:
document_custom_method(
action_section, action_name, resource_actions[action_name])
action_section, action_name, resource_actions[action_name]
)


def document_action(section, resource_name, event_emitter, action_model,
service_model, include_signature=True):
def document_action(
section,
resource_name,
event_emitter,
action_model,
service_model,
include_signature=True,
):
"""Documents a resource action
:param section: The section to write to
Expand All @@ -83,7 +97,8 @@ def document_action(section, resource_name, event_emitter, action_model,
It is useful for generating docstrings.
"""
operation_model = service_model.operation_model(
action_model.request.operation)
action_model.request.operation
)
ignore_params = get_resource_ignore_params(action_model.request.params)

example_return_value = 'response'
Expand All @@ -92,23 +107,31 @@ def document_action(section, resource_name, event_emitter, action_model,
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
example_resource_name = resource_name
example_prefix = '%s = %s.%s' % (
example_return_value, example_resource_name, action_model.name)
example_prefix = '{} = {}.{}'.format(
example_return_value, example_resource_name, action_model.name
)
document_model_driven_resource_method(
section=section, method_name=action_model.name,
section=section,
method_name=action_model.name,
operation_model=operation_model,
event_emitter=event_emitter,
method_description=operation_model.documentation,
example_prefix=example_prefix,
exclude_input=ignore_params,
resource_action_model=action_model,
include_signature=include_signature
include_signature=include_signature,
)


def document_load_reload_action(section, action_name, resource_name,
event_emitter, load_model, service_model,
include_signature=True):
def document_load_reload_action(
section,
action_name,
resource_name,
event_emitter,
load_model,
service_model,
include_signature=True,
):
"""Documents the resource load action
:param section: The section to write to
Expand All @@ -129,20 +152,23 @@ def document_load_reload_action(section, action_name, resource_name,
description = (
'Calls :py:meth:`%s.Client.%s` to update the attributes of the'
' %s resource. Note that the load and reload methods are '
'the same method and can be used interchangeably.' % (
'the same method and can be used interchangeably.'
% (
get_service_module_name(service_model),
xform_name(load_model.request.operation),
resource_name)
resource_name,
)
)
example_resource_name = xform_name(resource_name)
if service_model.service_name == resource_name:
example_resource_name = resource_name
example_prefix = '%s.%s' % (example_resource_name, action_name)
example_prefix = f'{example_resource_name}.{action_name}'
document_model_driven_method(
section=section, method_name=action_name,
section=section,
method_name=action_name,
operation_model=OperationModel({}, service_model),
event_emitter=event_emitter,
method_description=description,
example_prefix=example_prefix,
include_signature=include_signature
include_signature=include_signature,
)
27 changes: 18 additions & 9 deletions boto3/docs/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,36 @@ class ResourceShapeDocumenter(ResponseParamsDocumenter):
EVENT_NAME = 'resource-shape'


def document_attribute(section, service_name, resource_name, attr_name,
event_emitter, attr_model, include_signature=True):
def document_attribute(
section,
service_name,
resource_name,
attr_name,
event_emitter,
attr_model,
include_signature=True,
):
if include_signature:
section.style.start_sphinx_py_attr(attr_name)
# Note that an attribute may have one, may have many, or may have no
# operations that back the resource's shape. So we just set the
# operation_name to the resource name if we ever to hook in and modify
# a particular attribute.
ResourceShapeDocumenter(
service_name=service_name, operation_name=resource_name,
event_emitter=event_emitter).document_params(
section=section,
shape=attr_model)
service_name=service_name,
operation_name=resource_name,
event_emitter=event_emitter,
).document_params(section=section, shape=attr_model)


def document_identifier(section, resource_name, identifier_model,
include_signature=True):
def document_identifier(
section, resource_name, identifier_model, include_signature=True
):
if include_signature:
section.style.start_sphinx_py_attr(identifier_model.name)
description = get_identifier_description(
resource_name, identifier_model.name)
resource_name, identifier_model.name
)
description = '*(string)* ' + description
section.write(description)

Expand Down
7 changes: 4 additions & 3 deletions boto3/docs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from botocore.compat import OrderedDict


class BaseDocumenter(object):
class BaseDocumenter:
def __init__(self, resource):
self._resource = resource
self._client = self._resource.meta.client
Expand All @@ -24,8 +24,9 @@ def __init__(self, resource):
self._service_docs_name = self._client.__class__.__name__
self.member_map = OrderedDict()
self.represents_service_resource = (
self._service_name == self._resource_name)
self._service_name == self._resource_name
)

@property
def class_name(self):
return '%s.%s' % (self._service_docs_name, self._resource_name)
return f'{self._service_docs_name}.{self._resource_name}'
3 changes: 2 additions & 1 deletion boto3/docs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _add_client_creation_example(self, section):
section.style.new_line()
section.write(
'client = boto3.client(\'{service}\')'.format(
service=self._service_name)
service=self._service_name
)
)
section.style.end_codeblock()
Loading

0 comments on commit 0095f14

Please sign in to comment.