Skip to content

Commit b4e40e3

Browse files
removed-typehints-and-imports
1 parent 30367f3 commit b4e40e3

File tree

28 files changed

+58
-173
lines changed

28 files changed

+58
-173
lines changed

src/dynamodb_encryption_sdk/delegated_keys/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717

1818
from dynamodb_encryption_sdk.identifiers import EncryptionKeyType # noqa pylint: disable=unused-import
1919

20-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
21-
from typing import Dict, Optional, Text # noqa pylint: disable=unused-import
22-
except ImportError: # pragma: no cover
23-
# We only actually need these imports when running the mypy checks
24-
pass
20+
from typing import Dict, Optional, Text
2521

2622

2723
__all__ = ("DelegatedKey",)

src/dynamodb_encryption_sdk/delegated_keys/jce.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828

2929
from . import DelegatedKey
3030

31-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
32-
from typing import Dict, Optional, Text # noqa pylint: disable=unused-import
33-
except ImportError: # pragma: no cover
34-
# We only actually need these imports when running the mypy checks
35-
pass
31+
from typing import Dict, Optional, Text
3632

3733

3834
__all__ = ("JceNameLocalDelegatedKey",)

src/dynamodb_encryption_sdk/encrypted/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
from dynamodb_encryption_sdk.materials import CryptographicMaterials # noqa pylint: disable=unused-import
2222
from dynamodb_encryption_sdk.structures import AttributeActions, EncryptionContext
2323

24-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
25-
from typing import Dict # noqa pylint: disable=unused-import
26-
except ImportError: # pragma: no cover
27-
# We only actually need these imports when running the mypy checks
28-
pass
24+
from typing import Dict
2925

3026

3127
__all__ = ("CryptoConfig",)

src/dynamodb_encryption_sdk/encrypted/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@
3434

3535
from .item import decrypt_dynamodb_item, decrypt_python_item, encrypt_dynamodb_item, encrypt_python_item
3636

37-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
38-
from typing import Any, Callable, Dict, Iterator, Optional # noqa pylint: disable=unused-import
39-
except ImportError: # pragma: no cover
40-
# We only actually need these imports when running the mypy checks
41-
pass
37+
from typing import Any, Callable, Dict, Iterator, Optional
4238

4339

4440
__all__ = ("EncryptedClient", "EncryptedPaginator")

src/dynamodb_encryption_sdk/encrypted/item.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Top-level functions for encrypting and decrypting DynamoDB items."""
14-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
15-
from dynamodb_encryption_sdk.internal import dynamodb_types # noqa pylint: disable=unused-import
16-
except ImportError: # pragma: no cover
17-
# We only actually need these imports when running the mypy checks
18-
pass
14+
from dynamodb_encryption_sdk.internal import dynamodb_types
1915

2016
from dynamodb_encryption_sdk.exceptions import DecryptionError, EncryptionError
2117
from dynamodb_encryption_sdk.identifiers import CryptoAction
@@ -34,6 +30,7 @@
3430

3531
from . import CryptoConfig # noqa pylint: disable=unused-import
3632

33+
3734
__all__ = ("encrypt_dynamodb_item", "encrypt_python_item", "decrypt_dynamodb_item", "decrypt_python_item")
3835

3936

src/dynamodb_encryption_sdk/encrypted/resource.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
from .item import decrypt_python_item, encrypt_python_item
3030
from .table import EncryptedTable
3131

32-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
33-
from typing import Optional # noqa pylint: disable=unused-import
34-
except ImportError: # pragma: no cover
35-
# We only actually need these imports when running the mypy checks
36-
pass
32+
from typing import Optional
3733

3834

3935
__all__ = ("EncryptedResource", "EncryptedTablesCollectionManager")

src/dynamodb_encryption_sdk/encrypted/table.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
from .client import EncryptedClient
3131
from .item import decrypt_python_item, encrypt_python_item
3232

33-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
34-
from typing import Optional # noqa pylint: disable=unused-import
35-
except ImportError: # pragma: no cover
36-
# We only actually need these imports when running the mypy checks
37-
pass
33+
from typing import Optional
3834

3935

4036
__all__ = ("EncryptedTable",)

src/dynamodb_encryption_sdk/internal/crypto/authentication.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@
2626
from dynamodb_encryption_sdk.internal.identifiers import TEXT_ENCODING, SignatureValues, Tag
2727
from dynamodb_encryption_sdk.structures import AttributeActions # noqa pylint: disable=unused-import
2828

29-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
30-
from typing import Text # noqa pylint: disable=unused-import
29+
from typing import Text
3130

32-
from dynamodb_encryption_sdk.internal import dynamodb_types # noqa pylint: disable=unused-import
33-
except ImportError: # pragma: no cover
34-
# We only actually need these imports when running the mypy checks
35-
pass
31+
from dynamodb_encryption_sdk.internal import dynamodb_types
3632

3733

3834
__all__ = ("sign_item", "verify_item_signature")

src/dynamodb_encryption_sdk/internal/crypto/encryption.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616
No guarantee is provided on the modules and APIs within this
1717
namespace staying consistent. Directly reference at your own risk.
1818
"""
19-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
20-
from typing import Text # noqa pylint: disable=unused-import
2119

22-
from dynamodb_encryption_sdk.internal import dynamodb_types # noqa pylint: disable=unused-import
23-
except ImportError: # pragma: no cover
24-
# We only actually need these imports when running the mypy checks
25-
pass
20+
from typing import Text
21+
22+
from dynamodb_encryption_sdk.internal import dynamodb_types
2623

2724
from dynamodb_encryption_sdk.delegated_keys import DelegatedKey # noqa pylint: disable=unused-import
2825
from dynamodb_encryption_sdk.internal.formatting.deserialize.attribute import deserialize_attribute
2926
from dynamodb_encryption_sdk.internal.formatting.serialize.attribute import serialize_attribute
3027
from dynamodb_encryption_sdk.internal.identifiers import Tag
3128

29+
3230
__all__ = ("encrypt_attribute", "decrypt_attribute")
3331

3432

src/dynamodb_encryption_sdk/internal/crypto/jce_bridge/authentication.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@
3232

3333
from .primitives import load_rsa_key
3434

35-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
36-
from typing import Any, Callable, Text # noqa pylint: disable=unused-import
37-
except ImportError: # pragma: no cover
38-
# We only actually need these imports when running the mypy checks
39-
pass
35+
from typing import Any, Callable, Text
36+
4037

4138
__all__ = ("JavaAuthenticator", "JavaMac", "JavaSignature", "JAVA_AUTHENTICATOR")
4239
_LOGGER = logging.getLogger(LOGGER_NAME)

0 commit comments

Comments
 (0)