From 3f05e3fe8e05c8bcc122334ed469fbc303785c1e Mon Sep 17 00:00:00 2001 From: texastony <5892063+texastony@users.noreply.github.com> Date: Tue, 2 Nov 2021 18:20:38 -0500 Subject: [PATCH 1/4] ci(GitHub): update setup-python to v2 --- .github/workflows/ci_static-analysis.yaml | 2 +- .github/workflows/ci_tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_static-analysis.yaml b/.github/workflows/ci_static-analysis.yaml index 746f015e..1c867540 100644 --- a/.github/workflows/ci_static-analysis.yaml +++ b/.github/workflows/ci_static-analysis.yaml @@ -32,7 +32,7 @@ jobs: - black-check steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2 with: python-version: 3.8 - run: | diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 9cf5a738..86e3e8df 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -39,7 +39,7 @@ jobs: # - examples steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} architecture: ${{ matrix.platform.architecture }} From f0396299544b9c23924b45dd1f731352ff7a79a1 Mon Sep 17 00:00:00 2001 From: texastony <5892063+texastony@users.noreply.github.com> Date: Wed, 3 Nov 2021 14:53:07 -0500 Subject: [PATCH 2/4] ci(CodeBuild): update CodeBuild to the latest minor releases of python --- codebuild/python3.5.yml | 4 ++-- codebuild/python3.6.yml | 4 +++- codebuild/python3.7.yml | 4 ++-- codebuild/python3.8.yml | 4 ++-- codebuild/python3.9.yml | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/codebuild/python3.5.yml b/codebuild/python3.5.yml index f2b1dbcd..f0916074 100644 --- a/codebuild/python3.5.yml +++ b/codebuild/python3.5.yml @@ -26,7 +26,7 @@ phases: # Testing every minor version # is too extreme at this time. # The choice of versions should be reviewed. - - pyenv install 3.5.9 - - pyenv local 3.5.9 + - pyenv install 3.5.10 + - pyenv local 3.5.10 - pip install tox tox-pyenv - tox diff --git a/codebuild/python3.6.yml b/codebuild/python3.6.yml index 602dc113..864ea3b1 100644 --- a/codebuild/python3.6.yml +++ b/codebuild/python3.6.yml @@ -14,5 +14,7 @@ phases: python: latest build: commands: - - pip install tox + - pyenv install 3.6.15 + - pyenv local 3.6.15 + - pip install tox tox-pyenv - tox diff --git a/codebuild/python3.7.yml b/codebuild/python3.7.yml index 1ac0daa6..93e8a312 100644 --- a/codebuild/python3.7.yml +++ b/codebuild/python3.7.yml @@ -26,7 +26,7 @@ phases: # Testing every minor version # is too extreme at this time. # The choice of versions should be reviewed. - - pyenv install 3.7.9 - - pyenv local 3.7.9 + - pyenv install 3.7.12 + - pyenv local 3.7.12 - pip install tox tox-pyenv - tox diff --git a/codebuild/python3.8.yml b/codebuild/python3.8.yml index cbac65cf..c0170f2a 100644 --- a/codebuild/python3.8.yml +++ b/codebuild/python3.8.yml @@ -14,7 +14,7 @@ phases: python: latest build: commands: - - pyenv install 3.8.6 - - pyenv local 3.8.6 + - pyenv install 3.8.12 + - pyenv local 3.8.12 - pip install tox tox-pyenv - tox diff --git a/codebuild/python3.9.yml b/codebuild/python3.9.yml index 62868c80..f4de17ef 100644 --- a/codebuild/python3.9.yml +++ b/codebuild/python3.9.yml @@ -14,7 +14,7 @@ phases: python: latest build: commands: - - pyenv install 3.9.0 - - pyenv local 3.9.0 + - pyenv install 3.9.7 + - pyenv local 3.9.7 - pip install tox tox-pyenv - tox From a95b6a8cd547a214dabb368a925f37dd84d6c4b1 Mon Sep 17 00:00:00 2001 From: texastony <5892063+texastony@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:35:53 -0500 Subject: [PATCH 3/4] style: autoformat --- examples/test/examples_test_utils.py | 7 ++++++- examples/test/test_aws_kms_encrypted_examples.py | 7 ++++++- .../material_providers/most_recent.py | 4 +--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/test/examples_test_utils.py b/examples/test/examples_test_utils.py index 889b1290..92aad396 100644 --- a/examples/test/examples_test_utils.py +++ b/examples/test/examples_test_utils.py @@ -5,4 +5,9 @@ os.environ["AWS_ENCRYPTION_SDK_EXAMPLES_TESTING"] = "yes" sys.path.extend([os.sep.join([os.path.dirname(__file__), "..", "..", "test", "integration"])]) -from integration_test_utils import cmk_arn, cmk_mrk_arn, ddb_table_name, second_cmk_mrk_arn # noqa pylint: disable=unused-import +from integration_test_utils import ( + cmk_arn, + cmk_mrk_arn, + ddb_table_name, + second_cmk_mrk_arn, +) # noqa pylint: disable=unused-import diff --git a/examples/test/test_aws_kms_encrypted_examples.py b/examples/test/test_aws_kms_encrypted_examples.py index 3c0e8a36..a815683a 100644 --- a/examples/test/test_aws_kms_encrypted_examples.py +++ b/examples/test/test_aws_kms_encrypted_examples.py @@ -20,7 +20,12 @@ aws_kms_multi_region_key, ) -from .examples_test_utils import cmk_arn, cmk_mrk_arn, ddb_table_name, second_cmk_mrk_arn # noqa pylint: disable=unused-import +from .examples_test_utils import ( # noqa pylint: disable=unused-import + cmk_arn, + cmk_mrk_arn, + ddb_table_name, + second_cmk_mrk_arn, +) pytestmark = [pytest.mark.examples] diff --git a/src/dynamodb_encryption_sdk/material_providers/most_recent.py b/src/dynamodb_encryption_sdk/material_providers/most_recent.py index 349163e0..1606f6c0 100644 --- a/src/dynamodb_encryption_sdk/material_providers/most_recent.py +++ b/src/dynamodb_encryption_sdk/material_providers/most_recent.py @@ -35,9 +35,7 @@ pass -__all__ = ( - "CachingMostRecentProvider", -) +__all__ = ("CachingMostRecentProvider",) _LOGGER = logging.getLogger(LOGGER_NAME) #: Grace period during which we will return the latest local materials. This allows multiple #: threads to be using this same provider without risking lock contention or many threads From 1c3b71d131f00eb0560591b70d17cc57f60c9a34 Mon Sep 17 00:00:00 2001 From: texastony <5892063+texastony@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:08:59 -0500 Subject: [PATCH 4/4] style(example): disable autotformat and fix formatting for a special section --- examples/test/examples_test_utils.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/test/examples_test_utils.py b/examples/test/examples_test_utils.py index 92aad396..89ba1bba 100644 --- a/examples/test/examples_test_utils.py +++ b/examples/test/examples_test_utils.py @@ -1,13 +1,25 @@ -"""Helper utilities for use while testing examples.""" +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# 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. +"""Helper utilities for use while testing examples. + +isort:skip_file +""" import os import sys os.environ["AWS_ENCRYPTION_SDK_EXAMPLES_TESTING"] = "yes" sys.path.extend([os.sep.join([os.path.dirname(__file__), "..", "..", "test", "integration"])]) -from integration_test_utils import ( - cmk_arn, - cmk_mrk_arn, - ddb_table_name, - second_cmk_mrk_arn, -) # noqa pylint: disable=unused-import +# fmt: off +from integration_test_utils import cmk_arn, cmk_mrk_arn, ddb_table_name, second_cmk_mrk_arn # noqa pylint: disable=unused-import +# fmt: on