diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2021-08-29 14:18:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 15:18:18 -0400 |
commit | b5c3bd213099b6e35c30bee5d37258b5f084b901 (patch) | |
tree | 17a2f8da4b9c7b5bb4d137c0b39d9c69221b8047 | |
parent | eb6f658e5fccf0f5a66e1d6bdb4dda4ced5c6aa8 (diff) | |
download | cryptography-b5c3bd213099b6e35c30bee5d37258b5f084b901.tar.gz |
turn on mypy disallow implicit reexport and fix issues (#6240)
* turn on mypy disallow implicit reexport and fix issues
* import ordering
-rw-r--r-- | pyproject.toml | 1 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/padding.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/ciphers/base.py | 4 | ||||
-rw-r--r-- | src/cryptography/x509/__init__.py | 2 | ||||
-rw-r--r-- | src/cryptography/x509/base.py | 4 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_pkcs12.py | 2 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_pkcs7.py | 3 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 2 |
8 files changed, 14 insertions, 8 deletions
diff --git a/pyproject.toml b/pyproject.toml index 913a4e46d..cffd31708 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ markers = [ [tool.mypy] show_error_codes = true check_untyped_defs = true +no_implicit_reexport = true [[tool.mypy.overrides]] module = [ diff --git a/src/cryptography/hazmat/primitives/asymmetric/padding.py b/src/cryptography/hazmat/primitives/asymmetric/padding.py index 301c64c92..a97c5db09 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/padding.py +++ b/src/cryptography/hazmat/primitives/asymmetric/padding.py @@ -6,7 +6,9 @@ import typing from cryptography.hazmat.primitives import hashes -from cryptography.hazmat.primitives._asymmetric import AsymmetricPadding +from cryptography.hazmat.primitives._asymmetric import ( + AsymmetricPadding as AsymmetricPadding, +) from cryptography.hazmat.primitives.asymmetric import rsa diff --git a/src/cryptography/hazmat/primitives/ciphers/base.py b/src/cryptography/hazmat/primitives/ciphers/base.py index 7261a275b..ad3c7ed8f 100644 --- a/src/cryptography/hazmat/primitives/ciphers/base.py +++ b/src/cryptography/hazmat/primitives/ciphers/base.py @@ -16,7 +16,9 @@ from cryptography.exceptions import ( ) from cryptography.hazmat.backends import _get_backend from cryptography.hazmat.backends.interfaces import Backend, CipherBackend -from cryptography.hazmat.primitives._cipheralgorithm import CipherAlgorithm +from cryptography.hazmat.primitives._cipheralgorithm import ( + CipherAlgorithm as CipherAlgorithm, +) from cryptography.hazmat.primitives.ciphers import modes diff --git a/src/cryptography/x509/__init__.py b/src/cryptography/x509/__init__.py index 793714693..5003e09d3 100644 --- a/src/cryptography/x509/__init__.py +++ b/src/cryptography/x509/__init__.py @@ -244,4 +244,6 @@ __all__ = [ "PrecertPoison", "OCSPNonce", "SignedCertificateTimestamps", + "SignatureAlgorithmOID", + "NameOID", ] diff --git a/src/cryptography/x509/base.py b/src/cryptography/x509/base.py index 3c626efc5..0e8154425 100644 --- a/src/cryptography/x509/base.py +++ b/src/cryptography/x509/base.py @@ -21,8 +21,8 @@ from cryptography.hazmat.primitives.asymmetric import ( rsa, ) from cryptography.hazmat.primitives.asymmetric.types import ( - PRIVATE_KEY_TYPES, - PUBLIC_KEY_TYPES, + PRIVATE_KEY_TYPES as PRIVATE_KEY_TYPES, + PUBLIC_KEY_TYPES as PUBLIC_KEY_TYPES, ) from cryptography.x509.extensions import Extension, ExtensionType, Extensions from cryptography.x509.name import Name diff --git a/tests/hazmat/primitives/test_pkcs12.py b/tests/hazmat/primitives/test_pkcs12.py index 620066437..47262e5e1 100644 --- a/tests/hazmat/primitives/test_pkcs12.py +++ b/tests/hazmat/primitives/test_pkcs12.py @@ -18,8 +18,8 @@ from cryptography.hazmat.primitives.serialization.pkcs12 import ( serialize_key_and_certificates, ) -from .utils import load_vectors_from_file from ...doubles import DummyKeySerializationEncryption +from ...utils import load_vectors_from_file @pytest.mark.skip_fips( diff --git a/tests/hazmat/primitives/test_pkcs7.py b/tests/hazmat/primitives/test_pkcs7.py index 519c01b57..f90fd1810 100644 --- a/tests/hazmat/primitives/test_pkcs7.py +++ b/tests/hazmat/primitives/test_pkcs7.py @@ -14,8 +14,7 @@ from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import ed25519 from cryptography.hazmat.primitives.serialization import pkcs7 -from .utils import load_vectors_from_file -from ...utils import raises_unsupported_algorithm +from ...utils import load_vectors_from_file, raises_unsupported_algorithm class TestPKCS7Loading(object): diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 5c8450184..c9b8fd641 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -43,9 +43,9 @@ from .test_ec import _skip_curve_unsupported from .utils import ( _check_dsa_private_numbers, _check_rsa_private_numbers, - load_vectors_from_file, ) from ...doubles import DummyKeySerializationEncryption +from ...utils import load_vectors_from_file def _skip_fips_format(key_path, password, backend): |