Skip to content

Commit

Permalink
Run mypy in azure-keyvault-administration CI (#19246)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored Jun 14, 2021
1 parent 407d0b7 commit 9998221
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions eng/tox/mypy_hard_failure_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"azure-core",
"azure-eventhub",
"azure-identity",
"azure-keyvault-administration",
"azure-servicebus",
"azure-ai-textanalytics",
"azure-ai-formrecognizer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions sdk/keyvault/azure-keyvault-administration/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[mypy]
python_version = 3.6
warn_unused_configs = True
ignore_missing_imports = True

[mypy-azure.keyvault.*._generated.*]
ignore_errors = True
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9998221

Please sign in to comment.