Skip to content

Commit 63e157b

Browse files
authored
Merge pull request #433 from microsoft/andrueastman/python38drop
feat: drop support for python 3.8
2 parents 81ff8e8 + 3ef136c commit 63e157b

70 files changed

Lines changed: 352 additions & 350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
max-parallel: 10
2020
matrix:
21-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2222
library :
2323
- name: "kiota_abstractions"
2424
path: "./packages/abstractions"
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
max-parallel: 10
7878
matrix:
79-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
79+
python-version: ["3.9", "3.10", "3.11", "3.12"]
8080

8181
steps:
8282
- name: Checkout

packages/abstractions/kiota_abstractions/api_client_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable
1+
from collections.abc import Callable
22

33
from .serialization import (
44
ParseNodeFactory,

packages/abstractions/kiota_abstractions/api_error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Dict, Optional
2+
from typing import Optional
33

44

55
@dataclass
@@ -8,7 +8,7 @@ class APIError(Exception):
88

99
message: Optional[str] = None
1010
response_status_code: Optional[int] = None
11-
response_headers: Optional[Dict[str, str]] = None
11+
response_headers: Optional[dict[str, str]] = None
1212

1313
def __str__(self) -> str:
1414
error = getattr(self, "error", None)

packages/abstractions/kiota_abstractions/authentication/access_token_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ------------------------------------------------------------------------------
66

77
from abc import ABC, abstractmethod
8-
from typing import Any, Dict
8+
from typing import Any
99

1010
from .allowed_hosts_validator import AllowedHostsValidator
1111

@@ -16,7 +16,7 @@ class AccessTokenProvider(ABC):
1616

1717
@abstractmethod
1818
async def get_authorization_token(
19-
self, uri: str, additional_authentication_context: Dict[str, Any] = {}
19+
self, uri: str, additional_authentication_context: dict[str, Any] = {}
2020
) -> str:
2121
"""This method is called by the BaseBearerTokenAuthenticationProvider class to get the
2222
access token.

packages/abstractions/kiota_abstractions/authentication/allowed_hosts_validator.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import List, Set
21
from urllib.parse import urlparse
32

43

@@ -7,31 +6,31 @@ class AllowedHostsValidator:
76
a host is valid before authenticating a request
87
"""
98

10-
def __init__(self, allowed_hosts: List[str]) -> None:
9+
def __init__(self, allowed_hosts: list[str]) -> None:
1110
"""Creates a new AllowedHostsValidator object with provided values.
1211
1312
Args:
14-
allowed_hosts (List[str]): A list of valid hosts. If the list is empty, all hosts
13+
allowed_hosts (list[str]): A list of valid hosts. If the list is empty, all hosts
1514
are valid.
1615
"""
1716
if not isinstance(allowed_hosts, list):
1817
raise TypeError("Allowed hosts must be a list of strings")
1918

20-
self.allowed_hosts: Set[str] = {x.lower() for x in allowed_hosts}
19+
self.allowed_hosts: set[str] = {x.lower() for x in allowed_hosts}
2120

22-
def get_allowed_hosts(self) -> List[str]:
21+
def get_allowed_hosts(self) -> list[str]:
2322
"""Gets the list of valid hosts. If the list is empty, all hosts are valid.
2423
2524
Returns:
26-
List[str]: A list of valid hosts. If the list is empty, all hosts are valid.
25+
list[str]: A list of valid hosts. If the list is empty, all hosts are valid.
2726
"""
2827
return list(self.allowed_hosts)
2928

30-
def set_allowed_hosts(self, allowed_hosts: List[str]) -> None:
29+
def set_allowed_hosts(self, allowed_hosts: list[str]) -> None:
3130
"""Sets the list of valid hosts. If the list is empty, all hosts are valid.
3231
3332
Args:
34-
allowed_hosts (List[str]): A list of valid hosts. If the list is empty, all hosts
33+
allowed_hosts (list[str]): A list of valid hosts. If the list is empty, all hosts
3534
are valid
3635
"""
3736
if not isinstance(allowed_hosts, list):

packages/abstractions/kiota_abstractions/authentication/anonymous_authentication_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See License in the project root for license information.
55
# ------------------------------------------------------------------------------
66

7-
from typing import Any, Dict
7+
from typing import Any
88

99
from ..request_information import RequestInformation
1010
from .authentication_provider import AuthenticationProvider
@@ -20,7 +20,7 @@ class AnonymousAuthenticationProvider(AuthenticationProvider):
2020
async def authenticate_request(
2121
self,
2222
request: RequestInformation,
23-
additional_authentication_context: Dict[str, Any] = {}
23+
additional_authentication_context: dict[str, Any] = {}
2424
) -> None:
2525
"""Authenticates the provided request information
2626

packages/abstractions/kiota_abstractions/authentication/api_key_authentication_provider.py

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

77
from enum import Enum
8-
from typing import Any, Dict, List
8+
from typing import Any
99
from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse
1010

1111
from kiota_abstractions.request_information import RequestInformation
@@ -33,7 +33,7 @@ def __init__(
3333
key_location: KeyLocation,
3434
api_key: str,
3535
parameter_name: str,
36-
allowed_hosts: List[str] = [],
36+
allowed_hosts: list[str] = [],
3737
) -> None:
3838
if not isinstance(key_location, KeyLocation):
3939
err = "key_location can only be 'query_parameter' or 'header'"
@@ -56,7 +56,7 @@ def __init__(
5656
async def authenticate_request(
5757
self,
5858
request: RequestInformation,
59-
additional_authentication_context: Dict[str, Any] = {}
59+
additional_authentication_context: dict[str, Any] = {}
6060
) -> None:
6161
"""
6262
Ensures that the API key is placed in the correct location for a request.

packages/abstractions/kiota_abstractions/authentication/authentication_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ------------------------------------------------------------------------------
66

77
from abc import ABC, abstractmethod
8-
from typing import Any, Dict
8+
from typing import Any
99

1010
from ..request_information import RequestInformation
1111

@@ -19,7 +19,7 @@ class AuthenticationProvider(ABC):
1919
async def authenticate_request(
2020
self,
2121
request: RequestInformation,
22-
additional_authentication_context: Dict[str, Any] = {}
22+
additional_authentication_context: dict[str, Any] = {}
2323
) -> None:
2424
"""Authenticates the application request
2525

packages/abstractions/kiota_abstractions/authentication/base_bearer_token_authentication_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See License in the project root for license information.
55
# ------------------------------------------------------------------------------
66

7-
from typing import Any, Dict
7+
from typing import Any
88

99
from ..headers_collection import HeadersCollection
1010
from ..request_information import RequestInformation
@@ -24,7 +24,7 @@ def __init__(self, access_token_provider: AccessTokenProvider) -> None:
2424
async def authenticate_request(
2525
self,
2626
request: RequestInformation,
27-
additional_authentication_context: Dict[str, Any] = {}
27+
additional_authentication_context: dict[str, Any] = {}
2828
) -> None:
2929
"""Authenticates the provided RequestInformation instance using the provided
3030
authorization token

packages/abstractions/kiota_abstractions/base_request_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License.
44
# See License in the project root for license information.
55
# ------------------------------------
6-
from typing import Any, Dict, Optional, Union
6+
from typing import Any, Optional, Union
77

88
from .request_adapter import RequestAdapter
99
from .request_information import RequestInformation
@@ -14,7 +14,7 @@ class BaseRequestBuilder:
1414

1515
def __init__(
1616
self, request_adapter: RequestAdapter, url_template: str,
17-
path_parameters: Optional[Union[Dict[str, Any], str]]
17+
path_parameters: Optional[Union[dict[str, Any], str]]
1818
) -> None:
1919
"""Initializes a new instance of the BaseRequestBuilder class."""
2020
if path_parameters is None:
@@ -28,7 +28,7 @@ def __init__(
2828
raise TypeError("url_template cannot be null.") # Empty string is allowed
2929

3030
# Path parameters for the request
31-
self.path_parameters: Dict[str, Any] = path_parameters
31+
self.path_parameters: dict[str, Any] = path_parameters
3232
# Url template to use to build the URL for the current request builder
3333
self.url_template: str = url_template
3434
# The request adapter to use to execute the requests.

0 commit comments

Comments
 (0)