Skip to content

Commit 4f1db3e

Browse files
Enable pyright static type checking for azure-communication-email and fix type issues
Co-authored-by: kristapratico <31998003+kristapratico@users.noreply.github.com>
1 parent 524ed84 commit 4f1db3e

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

sdk/communication/azure-communication-email/azure/communication/email/_shared/policy.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
# -------------------------------------------------------------------------
66

77
import hashlib
8-
import urllib
98
import base64
109
import hmac
11-
from urllib.parse import ParseResult, urlparse
10+
from urllib.parse import ParseResult, urlparse, unquote
1211
from typing import Union
1312
from azure.core.credentials import AzureKeyCredential
1413
from azure.core.pipeline.policies import SansIOHTTPPolicy
@@ -42,7 +41,7 @@ def __init__(
4241
self._decode_url = decode_url
4342

4443
def _compute_hmac(
45-
self, value # type: str
44+
self, value: str
4645
):
4746
if isinstance(self._access_key, AzureKeyCredential):
4847
decoded_secret = base64.b64decode(self._access_key.key)
@@ -91,7 +90,7 @@ def _sign_request(self, request):
9190
pass
9291

9392
if self._decode_url:
94-
query_url = urllib.parse.unquote(query_url)
93+
query_url = unquote(query_url)
9594

9695
signed_headers = "x-ms-date;host;x-ms-content-sha256"
9796

sdk/communication/azure-communication-email/azure/communication/email/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
VERSION = "1.0.1b1"
1010

11-
SDK_MONIKER = "communication-email/{}".format(VERSION) # type: str
11+
SDK_MONIKER: str = "communication-email/{}".format(VERSION)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tool.azure-sdk-build]
2-
pyright = false
2+
pyright = true
33
type_check_samples = false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"exclude": [
3+
"**/_generated/**"
4+
]
5+
}

0 commit comments

Comments
 (0)