Skip to content

Commit da17313

Browse files
committed
chore: run isort
1 parent ea306f8 commit da17313

26 files changed

+43
-61
lines changed

decrypt_oracle/.chalice/pipeline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import argparse
33
import getpass
44
import logging
5-
from typing import Iterable
65

76
import boto3
87
import troposphere
@@ -20,6 +19,7 @@
2019
)
2120
from botocore.exceptions import ClientError
2221
from troposphere import GetAtt, Ref, Sub, Template, codebuild, codepipeline, iam, s3
22+
from typing import Iterable
2323

2424
APPLICATION_NAME = "AwsEncryptionSdkDecryptOraclePython"
2525
PIPELINE_STACK_NAME = "{}DeployPipeline".format(APPLICATION_NAME)

decrypt_oracle/src/aws_encryption_sdk_decrypt_oracle/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
import logging
1616
import os
1717

18+
from chalice import Chalice, Response
19+
1820
import aws_encryption_sdk
1921
from aws_encryption_sdk.key_providers.kms import DiscoveryAwsKmsMasterKeyProvider
20-
from chalice import Chalice, Response
2122

2223
from .key_providers.counting import CountingMasterKey
2324
from .key_providers.null import NullMasterKey

decrypt_oracle/test/integration/integration_test_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
import json
1616
import os
1717
from collections import namedtuple
18+
19+
import pytest
1820
from typing import Any, Callable, Iterable, Optional, Text
1921

2022
import aws_encryption_sdk
21-
import pytest
2223
from aws_encryption_sdk.identifiers import CommitmentPolicy
2324
from aws_encryption_sdk.key_providers.kms import StrictAwsKmsMasterKeyProvider
2425

decrypt_oracle/test/test_n_generate_test_vectors.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
import binascii
1616
import json
1717
import os
18+
19+
import pytest
20+
from aws_encryption_sdk_decrypt_oracle.key_providers.counting import CountingMasterKey
21+
from aws_encryption_sdk_decrypt_oracle.key_providers.null import NullMasterKey
1822
from typing import Dict, Iterable, Text
1923

2024
import aws_encryption_sdk
21-
import pytest
2225
from aws_encryption_sdk.key_providers.base import MasterKeyProvider
2326
from aws_encryption_sdk.key_providers.kms import KMSMasterKey
24-
from aws_encryption_sdk_decrypt_oracle.key_providers.counting import CountingMasterKey
25-
from aws_encryption_sdk_decrypt_oracle.key_providers.null import NullMasterKey
2627

2728
from .integration.integration_test_utils import test_vectors_filename
2829

examples/test/test_i_basic_encryption.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from ..src.basic_encryption import cycle_string
1818
from .examples_test_utils import get_cmk_arn, static_plaintext
1919

20-
2120
pytestmark = [pytest.mark.examples]
2221

2322

examples/test/test_i_basic_file_encryption_with_multiple_providers.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
import pytest
1919

2020
from ..src.basic_file_encryption_with_multiple_providers import cycle_file
21-
from .examples_test_utils import get_cmk_arn
22-
from .examples_test_utils import static_plaintext
23-
21+
from .examples_test_utils import get_cmk_arn, static_plaintext
2422

2523
pytestmark = [pytest.mark.examples]
2624

examples/test/test_i_basic_file_encryption_with_raw_key_provider.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from ..src.basic_file_encryption_with_raw_key_provider import cycle_file
2020
from .examples_test_utils import static_plaintext
2121

22-
2322
pytestmark = [pytest.mark.examples]
2423

2524

examples/test/test_i_data_key_caching_basic.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from ..src.data_key_caching_basic import encrypt_with_caching
1717
from .examples_test_utils import get_cmk_arn
1818

19-
2019
pytestmark = [pytest.mark.examples]
2120

2221

examples/test/test_i_discovery_kms_provider.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import pytest
1717

1818
from ..src.discovery_kms_provider import encrypt_decrypt
19-
from .examples_test_utils import get_cmk_arn
20-
from .examples_test_utils import static_plaintext
21-
19+
from .examples_test_utils import get_cmk_arn, static_plaintext
2220

2321
pytestmark = [pytest.mark.examples]
2422

examples/test/test_i_multiple_kms_cmk.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import pytest
1717

1818
from ..src.multiple_kms_cmk import encrypt_decrypt
19-
from .examples_test_utils import get_cmk_arn, get_second_cmk_arn
20-
from .examples_test_utils import static_plaintext
21-
19+
from .examples_test_utils import get_cmk_arn, get_second_cmk_arn, static_plaintext
2220

2321
pytestmark = [pytest.mark.examples]
2422

examples/test/test_i_one_kms_cmk.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import pytest
1717

1818
from ..src.one_kms_cmk import encrypt_decrypt
19-
from .examples_test_utils import get_cmk_arn
20-
from .examples_test_utils import static_plaintext
21-
19+
from .examples_test_utils import get_cmk_arn, static_plaintext
2220

2321
pytestmark = [pytest.mark.examples]
2422

examples/test/test_i_one_kms_cmk_streaming_data.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from ..src.one_kms_cmk_streaming_data import encrypt_decrypt_stream
2121
from .examples_test_utils import get_cmk_arn, static_plaintext
2222

23-
2423
pytestmark = [pytest.mark.examples]
2524

2625

examples/test/test_i_one_kms_cmk_unsigned.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import pytest
1717

1818
from ..src.one_kms_cmk_unsigned import encrypt_decrypt
19-
from .examples_test_utils import get_cmk_arn
20-
from .examples_test_utils import static_plaintext
21-
19+
from .examples_test_utils import get_cmk_arn, static_plaintext
2220

2321
pytestmark = [pytest.mark.examples]
2422

examples/test/test_i_set_commitment.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import pytest
1717

1818
from ..src.set_commitment import encrypt_decrypt
19-
from .examples_test_utils import get_cmk_arn
20-
from .examples_test_utils import static_plaintext
21-
19+
from .examples_test_utils import get_cmk_arn, static_plaintext
2220

2321
pytestmark = [pytest.mark.examples]
2422

src/aws_encryption_sdk/internal/crypto/authentication.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
import base64
1515
import logging
1616

17-
from aws_encryption_sdk.internal.utils import verify_interface
1817
from cryptography.hazmat.backends import default_backend
1918
from cryptography.hazmat.primitives import hashes, serialization
2019
from cryptography.hazmat.primitives.asymmetric import ec
2120
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
2221

22+
from aws_encryption_sdk.internal.utils import verify_interface
23+
2324
from ...exceptions import NotSupportedError
2425
from .elliptic_curve import (
2526
_ecc_encode_compressed_point,

src/aws_encryption_sdk/internal/crypto/elliptic_curve.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
from collections import namedtuple
1616

1717
import six
18-
from aws_encryption_sdk.internal.utils import verify_interface
1918
from cryptography.hazmat.backends import default_backend
2019
from cryptography.hazmat.primitives.asymmetric import ec
2120
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed, decode_dss_signature, encode_dss_signature
2221
from cryptography.utils import int_from_bytes, int_to_bytes
2322

23+
from aws_encryption_sdk.internal.utils import verify_interface
24+
2425
from ...exceptions import NotSupportedError
2526
from ..str_ops import to_bytes
2627

src/aws_encryption_sdk/internal/utils/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import os
1717

1818
import six
19+
from cryptography.hazmat.primitives.asymmetric import ec
1920

2021
import aws_encryption_sdk.internal.defaults
2122
from aws_encryption_sdk.exceptions import InvalidDataKeyError, SerializationError, UnknownIdentityError
2223
from aws_encryption_sdk.identifiers import ContentAADString, ContentType
2324
from aws_encryption_sdk.internal.str_ops import to_bytes
2425
from aws_encryption_sdk.structures import EncryptedDataKey
25-
from cryptography.hazmat.primitives.asymmetric import ec
2626

2727
from .streams import InsistentReaderBytesIO
2828

test/unit/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import aws_encryption_sdk.identifiers
2121
import aws_encryption_sdk.internal.utils
22-
from aws_encryption_sdk.internal.utils import verify_interface
2322
from aws_encryption_sdk.exceptions import InvalidDataKeyError, SerializationError, UnknownIdentityError
2423
from aws_encryption_sdk.internal.defaults import MAX_FRAME_SIZE, MESSAGE_ID_LENGTH
24+
from aws_encryption_sdk.internal.utils import verify_interface
2525
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, RawDataKey
2626

2727
from .test_values import VALUES

test_vector_handlers/src/awses_test_vectors/internal/aws_kms.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
from aws_encryption_sdk.identifiers import AlgorithmSuite
1616
except ImportError:
1717
from aws_encryption_sdk.identifiers import Algorithm as AlgorithmSuite
18-
from aws_encryption_sdk.key_providers.kms import DiscoveryAwsKmsMasterKeyProvider, StrictAwsKmsMasterKeyProvider
1918

2019
from awses_test_vectors.internal.defaults import ENCODING
2120

21+
from aws_encryption_sdk.key_providers.kms import DiscoveryAwsKmsMasterKeyProvider, StrictAwsKmsMasterKeyProvider
22+
2223
# This lets us easily use a single boto3 client per region for all KMS master keys.
2324
KMS_MASTER_KEY_PROVIDER = DiscoveryAwsKmsMasterKeyProvider()
2425

test_vector_handlers/src/awses_test_vectors/internal/util.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
from aws_encryption_sdk.identifiers import Algorithm as AlgorithmSuite
2525

2626
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
27-
from typing import Any, Callable, Dict, Iterable, Type # noqa pylint: disable=unused-import
28-
2927
from awses_test_vectors.internal.mypy_types import ( # noqa pylint: disable=unused-import
3028
ISINSTANCE,
3129
MANIFEST_VERSION,
3230
)
31+
from typing import Any, Callable, Dict, Iterable, Type # noqa pylint: disable=unused-import
3332
except ImportError: # pragma: no cover
3433
# We only actually need these imports when running the mypy checks
3534
pass

test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@
2020
from enum import Enum
2121

2222
import attr
23-
import aws_encryption_sdk
2423
import pytest
2524
import six
26-
from aws_encryption_sdk.identifiers import CommitmentPolicy
27-
from aws_encryption_sdk.key_providers.base import MasterKeyProvider
28-
2925
from awses_test_vectors.internal.defaults import ENCODING
3026
from awses_test_vectors.internal.util import (
3127
dictionary_validator,
@@ -36,14 +32,17 @@
3632
from awses_test_vectors.manifests.keys import KeysManifest
3733
from awses_test_vectors.manifests.master_key import MasterKeySpec, master_key_provider_from_master_key_specs
3834

39-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
40-
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
35+
import aws_encryption_sdk
36+
from aws_encryption_sdk.identifiers import CommitmentPolicy
37+
from aws_encryption_sdk.key_providers.base import MasterKeyProvider
4138

39+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
4240
from awses_test_vectors.internal.mypy_types import ( # noqa pylint: disable=unused-import
4341
DECRYPT_SCENARIO_SPEC,
4442
FULL_MESSAGE_DECRYPT_MANIFEST,
4543
MASTER_KEY_SPEC,
4644
)
45+
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
4746
except ImportError: # pragma: no cover
4847
# We only actually need these imports when running the mypy checks
4948
pass

test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt_generation.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
import attr
2525
import six
26-
from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager
27-
from aws_encryption_sdk.materials_managers.default import DefaultCryptoMaterialsManager
28-
2926
from awses_test_vectors.internal.defaults import ENCODING
3027
from awses_test_vectors.internal.util import (
3128
dictionary_validator,
@@ -43,19 +40,21 @@
4340
from awses_test_vectors.manifests.full_message.encrypt import MessageEncryptionTestScenario
4441
from awses_test_vectors.manifests.keys import KeysManifest
4542

43+
from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager
44+
from aws_encryption_sdk.materials_managers.default import DefaultCryptoMaterialsManager
45+
4646
try:
4747
from aws_encryption_sdk.identifiers import AlgorithmSuite
4848
except ImportError:
4949
from aws_encryption_sdk.identifiers import Algorithm as AlgorithmSuite
5050

5151

5252
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
53-
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
54-
5553
from awses_test_vectors.internal.mypy_types import ( # noqa pylint: disable=unused-import
5654
ENCRYPT_SCENARIO_SPEC,
5755
PLAINTEXTS_SPEC,
5856
)
57+
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
5958
except ImportError: # pragma: no cover
6059
# We only actually need these imports when running the mypy checks
6160
pass

test_vector_handlers/src/awses_test_vectors/manifests/full_message/encrypt.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import os
2020

2121
import attr
22-
import aws_encryption_sdk
2322
import six
24-
from aws_encryption_sdk.key_providers.base import MasterKeyProvider
25-
2623
from awses_test_vectors.internal.defaults import ENCODING
2724
from awses_test_vectors.internal.util import (
2825
algorithm_suite_from_string_id,
@@ -35,19 +32,21 @@
3532
from awses_test_vectors.manifests.keys import KeysManifest
3633
from awses_test_vectors.manifests.master_key import MasterKeySpec, master_key_provider_from_master_key_specs
3734

35+
import aws_encryption_sdk
36+
from aws_encryption_sdk.key_providers.base import MasterKeyProvider
37+
3838
try:
3939
from aws_encryption_sdk.identifiers import AlgorithmSuite, CommitmentPolicy
4040
except ImportError:
4141
from aws_encryption_sdk.identifiers import Algorithm as AlgorithmSuite
4242

4343

4444
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
45-
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
46-
4745
from awses_test_vectors.internal.mypy_types import ( # noqa pylint: disable=unused-import
4846
ENCRYPT_SCENARIO_SPEC,
4947
PLAINTEXTS_SPEC,
5048
)
49+
from typing import IO, Callable, Dict, Iterable, Optional # noqa pylint: disable=unused-import
5150
except ImportError: # pragma: no cover
5251
# We only actually need these imports when running the mypy checks
5352
pass

test_vector_handlers/src/awses_test_vectors/manifests/keys.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@
1919

2020
import attr
2121
import six
22-
2322
from awses_test_vectors.internal.aws_kms import arn_from_key_id
2423
from awses_test_vectors.internal.defaults import ENCODING
2524
from awses_test_vectors.internal.util import dictionary_validator, membership_validator, validate_manifest_type
2625

2726
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
28-
from typing import Dict, Iterable, Optional, cast # noqa pylint: disable=unused-import
29-
3027
from awses_test_vectors.internal.mypy_types import ( # noqa pylint: disable=unused-import
3128
AWS_KMS_KEY_SPEC,
3229
KEY_SPEC,
3330
KEYS_MANIFEST,
3431
MANIFEST_VERSION,
3532
MANUAL_KEY_SPEC,
3633
)
34+
from typing import Dict, Iterable, Optional, cast # noqa pylint: disable=unused-import
3735
except ImportError: # pragma: no cover
3836
# We only actually need these imports when running the mypy checks
3937
pass

test_vector_handlers/src/awses_test_vectors/manifests/master_key.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,24 @@
1717
"""
1818
import attr
1919
import six
20+
from awses_test_vectors.internal.aws_kms import KMS_MASTER_KEY_PROVIDER
21+
from awses_test_vectors.internal.util import membership_validator
22+
from awses_test_vectors.manifests.keys import KeysManifest, KeySpec # noqa pylint: disable=unused-import
23+
2024
from aws_encryption_sdk.identifiers import EncryptionKeyType, WrappingAlgorithm
2125
from aws_encryption_sdk.key_providers.base import MasterKeyProvider # noqa pylint: disable=unused-import
2226
from aws_encryption_sdk.key_providers.kms import KMSMasterKey # noqa pylint: disable=unused-import
2327
from aws_encryption_sdk.key_providers.raw import RawMasterKey
2428

25-
from awses_test_vectors.internal.aws_kms import KMS_MASTER_KEY_PROVIDER
26-
from awses_test_vectors.internal.util import membership_validator
27-
from awses_test_vectors.manifests.keys import KeysManifest, KeySpec # noqa pylint: disable=unused-import
28-
2929
try:
3030
from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey
3131
except ImportError:
3232
from aws_encryption_sdk.internal.crypto import WrappingKey
3333

3434

3535
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
36-
from typing import Iterable # noqa pylint: disable=unused-import
37-
3836
from awses_test_vectors.internal.mypy_types import MASTER_KEY_SPEC # noqa pylint: disable=unused-import
37+
from typing import Iterable # noqa pylint: disable=unused-import
3938
except ImportError: # pragma: no cover
4039
# We only actually need these imports when running the mypy checks
4140
pass

0 commit comments

Comments
 (0)