Skip to content

Commit

Permalink
Merge branch 'release-1.18.58'
Browse files Browse the repository at this point in the history
* release-1.18.58:
  Bumping version to 1.18.58
  Add changelog entries from botocore
  Fix flake8 conflicts
  Add pre-commit config
  • Loading branch information
aws-sdk-python-automation committed Oct 8, 2021
2 parents 5ecd069 + 1ad7bb3 commit 7f4cb35
Show file tree
Hide file tree
Showing 37 changed files with 293 additions and 151 deletions.
32 changes: 32 additions & 0 deletions .changes/1.18.58.json
@@ -0,0 +1,32 @@
[
{
"category": "``lexv2-runtime``",
"description": "[``botocore``] Update lexv2-runtime client to latest version",
"type": "api-change"
},
{
"category": "``lexv2-models``",
"description": "[``botocore``] Update lexv2-models client to latest version",
"type": "api-change"
},
{
"category": "``secretsmanager``",
"description": "[``botocore``] Documentation updates for Secrets Manager",
"type": "api-change"
},
{
"category": "``securityhub``",
"description": "[``botocore``] Added new resource details objects to ASFF, including resources for WAF rate-based rules, EC2 VPC endpoints, ECR repositories, EKS clusters, X-Ray encryption, and OpenSearch domains. Added additional details for CloudFront distributions, CodeBuild projects, ELB V2 load balancers, and S3 buckets.",
"type": "api-change"
},
{
"category": "``mediaconvert``",
"description": "[``botocore``] AWS Elemental MediaConvert has added the ability to set account policies which control access restrictions for HTTP, HTTPS, and S3 content sources.",
"type": "api-change"
},
{
"category": "``ec2``",
"description": "[``botocore``] This release removes a requirement for filters on SearchLocalGatewayRoutes operations.",
"type": "api-change"
}
]
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,19 @@
name: Lint code

on:
push:
pull_request:
branches-ignore: [ master ]

jobs:
lint:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Run pre-commit
uses: pre-commit/action@v2.0.0
1 change: 0 additions & 1 deletion .github/workflows/run-tests.yml
@@ -1,4 +1,3 @@

name: Run tests

on:
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,12 @@
exclude: ^(.github|.changes|docs/|boto3/compat.py|boto3/data)
repos:
- 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
rev: 3.9.2
hooks:
- id: flake8
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -2,6 +2,17 @@
CHANGELOG
=========

1.18.58
=======

* api-change:``lexv2-runtime``: [``botocore``] Update lexv2-runtime client to latest version
* api-change:``lexv2-models``: [``botocore``] Update lexv2-models client to latest version
* api-change:``secretsmanager``: [``botocore``] Documentation updates for Secrets Manager
* api-change:``securityhub``: [``botocore``] Added new resource details objects to ASFF, including resources for WAF rate-based rules, EC2 VPC endpoints, ECR repositories, EKS clusters, X-Ray encryption, and OpenSearch domains. Added additional details for CloudFront distributions, CodeBuild projects, ELB V2 load balancers, and S3 buckets.
* api-change:``mediaconvert``: [``botocore``] AWS Elemental MediaConvert has added the ability to set account policies which control access restrictions for HTTP, HTTPS, and S3 content sources.
* api-change:``ec2``: [``botocore``] This release removes a requirement for filters on SearchLocalGatewayRoutes operations.


1.18.57
=======

Expand Down
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Expand Up @@ -2,4 +2,3 @@
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.

7 changes: 3 additions & 4 deletions README.rst
Expand Up @@ -49,10 +49,10 @@ Assuming that you have Python and ``virtualenv`` installed, set up your environm
$ python -m pip install boto3
Using Boto3
~~~~~~~~~~~~~~
After installing boto3
After installing boto3

Next, set up credentials (in e.g. ``~/.aws/credentials``):

Expand All @@ -68,7 +68,7 @@ Then, set up a default region (in e.g. ``~/.aws/config``):
[default]
region=us-east-1
Other credentials configuration method can be found `here <https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html>`__

Then, from a Python interpreter:
Expand Down Expand Up @@ -137,4 +137,3 @@ More Resources
* `NOTICE <https://github.com/boto/boto3/blob/develop/NOTICE>`__
* `Changelog <https://github.com/boto/boto3/blob/develop/CHANGELOG.rst>`__
* `License <https://github.com/boto/boto3/blob/develop/LICENSE>`__

2 changes: 1 addition & 1 deletion boto3/__init__.py
Expand Up @@ -18,7 +18,7 @@


__author__ = 'Amazon Web Services'
__version__ = '1.18.57'
__version__ = '1.18.58'


# The default Boto3 session; autoloaded when needed.
Expand Down
2 changes: 1 addition & 1 deletion boto3/compat.py
Expand Up @@ -75,7 +75,7 @@ def _warn_deprecated_python():
'aws-cli-v1/'
}
deprecated_versions = {
(2,7): py_27_params,
(2, 7): py_27_params,
}
py_version = sys.version_info[:2]

Expand Down
8 changes: 5 additions & 3 deletions boto3/docs/collection.py
Expand Up @@ -185,11 +185,13 @@ def document_collection_method(section, resource_name, action_name,
'method_description': (
'Creates an iterable of all %s resources '
'in the collection filtered by kwargs passed to '
'method.' % collection_model.resource.type +
'A %s collection will include all resources by '
'method. A %s collection will include all resources by '
'default if no filters are provided, and extreme '
'caution should be taken when performing actions '
'on all resources.'% collection_model.resource.type),
'on all resources.' % (
collection_model.resource.type,
collection_model.resource.type
)),
'example_prefix': '%s_iterator = %s.%s.filter' % (
xform_name(collection_model.resource.type),
example_resource_name, collection_model.name),
Expand Down
5 changes: 3 additions & 2 deletions boto3/dynamodb/conditions.py
Expand Up @@ -144,8 +144,9 @@ def __init__(self, *values):
AttributeBase.__init__(self, values[0].name)

def __eq__(self, other):
return ConditionBase.__eq__(self, other) and \
AttributeBase.__eq__(self, other)
return (
ConditionBase.__eq__(self, other) and AttributeBase.__eq__(self, other)
)

def __ne__(self, other):
return not self.__eq__(other)
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/run-crt-tests
Expand Up @@ -29,7 +29,7 @@ def run(command):


try:
import awscrt
import awscrt # noqa
except ImportError:
print("MISSING DEPENDENCY: awscrt must be installed to run the crt tests.")
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion scripts/new-change
Expand Up @@ -135,7 +135,7 @@ def replace_issue_references(parsed, repo_name):
'`%s <https://github.com/%s/issues/%s>`__' % (
match.group(), repo_name, number))

new_description = re.sub('#\d+', linkify, description)
new_description = re.sub(r'#\d+', linkify, description)
parsed['description'] = new_description


Expand Down
10 changes: 9 additions & 1 deletion setup.cfg
Expand Up @@ -3,9 +3,17 @@ universal = 0

[metadata]
requires_dist =
botocore>=1.21.57,<1.22.0
botocore>=1.21.58,<1.22.0
jmespath>=0.7.1,<1.0.0
s3transfer>=0.5.0,<0.6.0

[options.extras_require]
crt = botocore[crt]>=1.21.0,<2.0a0

[flake8]
ignore = E203,E501,W503,W504
exclude =
docs,
boto3/compat.py,
boto3/data,
.changes
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -13,7 +13,7 @@


requires = [
'botocore>=1.21.57,<1.22.0',
'botocore>=1.21.58,<1.22.0',
'jmespath>=0.7.1,<1.0.0',
's3transfer>=0.5.0,<0.6.0'
]
Expand Down
12 changes: 0 additions & 12 deletions tests/__init__.py
Expand Up @@ -12,24 +12,12 @@
# language governing permissions and limitations under the License.

import random
import sys
import time

from botocore.compat import six


import unittest
from unittest import mock


# In python 3, order matters when calling assertEqual to
# compare lists and dictionaries with lists. Therefore,
# assertItemsEqual needs to be used but it is renamed to
# assertCountEqual in python 3.
if six.PY2:
unittest.TestCase.assertCountEqual = unittest.TestCase.assertItemsEqual


def unique_id(name):
"""
Generate a unique ID that includes the given name,
Expand Down
22 changes: 14 additions & 8 deletions tests/functional/docs/test_ec2.py
Expand Up @@ -19,17 +19,23 @@
class TestInstanceDeleteTags(BaseDocsFunctionalTests):
def setUp(self):
self.documenter = ServiceDocumenter(
'ec2', session=Session(region_name='us-east-1'))
'ec2', session=Session(region_name='us-east-1')
)
self.generated_contents = self.documenter.document_service()
self.generated_contents = self.generated_contents.decode('utf-8')

def test_delete_tags_method_is_documented(self):
contents = self.get_class_document_block(
'EC2.Instance', self.generated_contents)
'EC2.Instance', self.generated_contents
)
method_contents = self.get_method_document_block(
'delete_tags', contents)
self.assert_contains_lines_in_order([
'response = instance.delete_tags(',
'DryRun=True|False,',
'Tags=[',
], method_contents)
'delete_tags', contents
)
self.assert_contains_lines_in_order(
[
'response = instance.delete_tags(',
'DryRun=True|False,',
'Tags=[',
],
method_contents
)
15 changes: 6 additions & 9 deletions tests/functional/docs/test_smoke.py
Expand Up @@ -23,12 +23,13 @@
def botocore_session():
return botocore.session.get_session()


@pytest.fixture
def boto3_session():
return boto3.Session(region_name='us-east-1')


def all_services():
botocore_session = botocore.session.get_session()
session = boto3.Session(region_name='us-east-1')
for service_name in session.get_available_services():
yield service_name
Expand All @@ -52,32 +53,28 @@ def test_documentation(
# Check that all of the services have the appropriate title
_assert_has_title(generated_docs, client)


# Check that all services have the client documented.
_assert_has_client_documentation(generated_docs, service_name, client)


#If the service has resources, make sure the service resource
#is at least documented.
# If the service has resources, make sure the service resource
# is at least documented.
if service_name in available_resources:

resource = boto3.resource(service_name, 'us-east-1')
_assert_has_resource_documentation(
generated_docs, service_name, resource
)

# If the client can paginate, make sure the paginators are documented.
try:
paginator_model = botocore_session.get_paginator_model(
service_name)
paginator_model = botocore_session.get_paginator_model(service_name)
_assert_has_paginator_documentation(
generated_docs, service_name, client,
sorted(paginator_model._paginator_config)
)
except DataNotFoundError:
pass


# If the client has waiters, make sure the waiters are documented.
if client.waiter_names:
waiter_model = botocore_session.get_waiter_model(service_name)
Expand Down
21 changes: 15 additions & 6 deletions tests/functional/dynamodb/test_stubber_conditions.py
Expand Up @@ -31,11 +31,15 @@ def test_table_query_can_be_stubbed_with_expressions(self):
)

stubber = Stubber(table.meta.client)
stubber.add_response('query', dict(Items=list()), expected_params=dict(
stubber.add_response(
'query',
dict(Items=list()),
expected_params=dict(
TableName='mytable',
KeyConditionExpression=key_expr,
FilterExpression=filter_expr
))
)
)

with stubber:
response = table.query(KeyConditionExpression=key_expr,
Expand All @@ -46,15 +50,20 @@ def test_table_query_can_be_stubbed_with_expressions(self):

def test_table_scan_can_be_stubbed_with_expressions(self):
table = self.resource.Table('mytable')
filter_expr = Attr('myattr').eq('foo') & (
Attr('myattr2').lte('buzz') | Attr('myattr2').gte('fizz')
filter_expr = (
Attr('myattr').eq('foo') &
(Attr('myattr2').lte('buzz') | Attr('myattr2').gte('fizz'))
)

stubber = Stubber(table.meta.client)
stubber.add_response('scan', dict(Items=list()), expected_params=dict(
stubber.add_response(
'scan',
dict(Items=list()),
expected_params=dict(
TableName='mytable',
FilterExpression=filter_expr
))
)
)

with stubber:
response = table.scan(FilterExpression=filter_expr)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/dynamodb/test_table.py
Expand Up @@ -10,7 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from tests import unittest, mock
from tests import unittest

import boto3
from botocore.stub import Stubber
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_s3.py
Expand Up @@ -377,7 +377,7 @@ def stub_get_object(self, full_contents, start_byte=0, end_byte=None):
# If this is a ranged get, ContentRange needs to be returned,
# contents needs to be pruned, and Range needs to be an expected param.
if end_byte is not None:
contents = full_contents[start_byte:end_byte+1]
contents = full_contents[start_byte:end_byte + 1]
part_range = 'bytes=%s-%s' % (start_byte, end_byte_range)
content_range = 'bytes=%s-%s/%s' % (
start_byte, end_byte, len(full_contents))
Expand Down

0 comments on commit 7f4cb35

Please sign in to comment.