diff --git a/eng/tox/mypy_hard_failure_packages.py b/eng/tox/mypy_hard_failure_packages.py index dfc43744fc6d..d0306ede7730 100644 --- a/eng/tox/mypy_hard_failure_packages.py +++ b/eng/tox/mypy_hard_failure_packages.py @@ -9,6 +9,7 @@ "azure-core", "azure-eventhub", "azure-identity", + "azure-keyvault-administration", "azure-servicebus", "azure-ai-textanalytics", "azure-ai-formrecognizer", diff --git a/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_internal/challenge_auth_policy.py b/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_internal/challenge_auth_policy.py index fca7dc6f01d2..3239032e9162 100644 --- a/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_internal/challenge_auth_policy.py +++ b/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_internal/challenge_auth_policy.py @@ -31,9 +31,9 @@ TYPE_CHECKING = False if TYPE_CHECKING: - from typing import Any, Dict, Optional + from typing import Any, Optional from azure.core.credentials import AccessToken, TokenCredential - from azure.core.pipeline.transport import HttpResponse + from azure.core.pipeline import PipelineResponse def _enforce_tls(request): @@ -61,7 +61,7 @@ def _get_challenge_request(request): def _update_challenge(request, challenger): - # type: (HttpRequest, HttpResponse) -> HttpChallenge + # type: (PipelineRequest, PipelineResponse) -> HttpChallenge """parse challenge from challenger, cache it, return it""" challenge = HttpChallenge( @@ -95,7 +95,7 @@ def __init__(self, credential, **kwargs): super(ChallengeAuthPolicy, self).__init__(**kwargs) def send(self, request): - # type: (PipelineRequest) -> HttpResponse + # type: (PipelineRequest) -> PipelineResponse _enforce_tls(request) challenge = ChallengeCache.get_challenge_for_url(request.http_request.url) diff --git a/sdk/keyvault/azure-keyvault-administration/mypy.ini b/sdk/keyvault/azure-keyvault-administration/mypy.ini new file mode 100644 index 000000000000..18b37b44c426 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-administration/mypy.ini @@ -0,0 +1,7 @@ +[mypy] +python_version = 3.6 +warn_unused_configs = True +ignore_missing_imports = True + +[mypy-azure.keyvault.*._generated.*] +ignore_errors = True diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/challenge_auth_policy.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/challenge_auth_policy.py index fca7dc6f01d2..3239032e9162 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/challenge_auth_policy.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/challenge_auth_policy.py @@ -31,9 +31,9 @@ TYPE_CHECKING = False if TYPE_CHECKING: - from typing import Any, Dict, Optional + from typing import Any, Optional from azure.core.credentials import AccessToken, TokenCredential - from azure.core.pipeline.transport import HttpResponse + from azure.core.pipeline import PipelineResponse def _enforce_tls(request): @@ -61,7 +61,7 @@ def _get_challenge_request(request): def _update_challenge(request, challenger): - # type: (HttpRequest, HttpResponse) -> HttpChallenge + # type: (PipelineRequest, PipelineResponse) -> HttpChallenge """parse challenge from challenger, cache it, return it""" challenge = HttpChallenge( @@ -95,7 +95,7 @@ def __init__(self, credential, **kwargs): super(ChallengeAuthPolicy, self).__init__(**kwargs) def send(self, request): - # type: (PipelineRequest) -> HttpResponse + # type: (PipelineRequest) -> PipelineResponse _enforce_tls(request) challenge = ChallengeCache.get_challenge_for_url(request.http_request.url) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py index fca7dc6f01d2..3239032e9162 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py @@ -31,9 +31,9 @@ TYPE_CHECKING = False if TYPE_CHECKING: - from typing import Any, Dict, Optional + from typing import Any, Optional from azure.core.credentials import AccessToken, TokenCredential - from azure.core.pipeline.transport import HttpResponse + from azure.core.pipeline import PipelineResponse def _enforce_tls(request): @@ -61,7 +61,7 @@ def _get_challenge_request(request): def _update_challenge(request, challenger): - # type: (HttpRequest, HttpResponse) -> HttpChallenge + # type: (PipelineRequest, PipelineResponse) -> HttpChallenge """parse challenge from challenger, cache it, return it""" challenge = HttpChallenge( @@ -95,7 +95,7 @@ def __init__(self, credential, **kwargs): super(ChallengeAuthPolicy, self).__init__(**kwargs) def send(self, request): - # type: (PipelineRequest) -> HttpResponse + # type: (PipelineRequest) -> PipelineResponse _enforce_tls(request) challenge = ChallengeCache.get_challenge_for_url(request.http_request.url) diff --git a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/challenge_auth_policy.py b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/challenge_auth_policy.py index fca7dc6f01d2..3239032e9162 100644 --- a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/challenge_auth_policy.py +++ b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/challenge_auth_policy.py @@ -31,9 +31,9 @@ TYPE_CHECKING = False if TYPE_CHECKING: - from typing import Any, Dict, Optional + from typing import Any, Optional from azure.core.credentials import AccessToken, TokenCredential - from azure.core.pipeline.transport import HttpResponse + from azure.core.pipeline import PipelineResponse def _enforce_tls(request): @@ -61,7 +61,7 @@ def _get_challenge_request(request): def _update_challenge(request, challenger): - # type: (HttpRequest, HttpResponse) -> HttpChallenge + # type: (PipelineRequest, PipelineResponse) -> HttpChallenge """parse challenge from challenger, cache it, return it""" challenge = HttpChallenge( @@ -95,7 +95,7 @@ def __init__(self, credential, **kwargs): super(ChallengeAuthPolicy, self).__init__(**kwargs) def send(self, request): - # type: (PipelineRequest) -> HttpResponse + # type: (PipelineRequest) -> PipelineResponse _enforce_tls(request) challenge = ChallengeCache.get_challenge_for_url(request.http_request.url)