Skip to content

Commit d5d925e

Browse files
author
Andrew Omondi
committed
feat: drop support for python 3.8 and drops deprecated type aliases
1 parent 49b2ea6 commit d5d925e

23 files changed

+165
-154
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
max-parallel: 5
1919
matrix:
20-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2121

2222
steps:
2323
- uses: actions/checkout@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Microsoft Graph Core Python Client Library contains core classes used by [Mi
1212
1313
## Prerequisites
1414

15-
Python 3.8+
15+
Python 3.9+
1616

1717
This library doesn't support [older](https://devguide.python.org/versions/) versions of Python.
1818

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ dependencies = [
1616
"microsoft-kiota-http >=1.0.0,<2.0.0",
1717
"httpx[http2] >=0.23.0",
1818
]
19-
requires-python = ">=3.8"
19+
requires-python = ">=3.9"
2020
license = {file = "LICENSE"}
2121
readme = "README.md"
2222
keywords = ["msgraph", "openAPI", "Microsoft", "Graph"]
2323
classifiers = [
2424
"Development Status :: 5 - Production/Stable",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",

requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ httpx[http2]==0.28.1
145145

146146
hyperframe==6.0.1 ; python_full_version >= '3.6.1'
147147

148-
microsoft-kiota-abstractions==1.6.8
148+
microsoft-kiota-abstractions==1.7.0
149149

150-
microsoft-kiota-authentication-azure==1.6.8
150+
microsoft-kiota-authentication-azure==1.7.0
151151

152-
microsoft-kiota-http==1.6.8
152+
microsoft-kiota-http==1.7.0
153153

154154
multidict==6.1.0 ; python_version >= '3.7'
155155

src/msgraph_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .authentication import AzureIdentityAuthenticationProvider
1414
from .base_graph_request_adapter import BaseGraphRequestAdapter
1515
from .graph_client_factory import GraphClientFactory
16-
from .tasks import PageIterator
1716
from .models import PageResult
17+
from .tasks import PageIterator
1818

1919
__version__ = SDK_VERSION

src/msgraph_core/authentication/azure_identity_authentication_provider.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Dict, List, Optional, Union
1+
from typing import TYPE_CHECKING, Optional, Union
22

33
from kiota_authentication_azure.azure_identity_authentication_provider import (
44
AzureIdentityAuthenticationProvider as KiotaAzureIdentityAuthenticationProvider,
@@ -17,19 +17,19 @@ class AzureIdentityAuthenticationProvider(KiotaAzureIdentityAuthenticationProvid
1717
def __init__(
1818
self,
1919
credentials: Union["TokenCredential", "AsyncTokenCredential"],
20-
options: Optional[Dict] = {},
21-
scopes: List[str] = [],
22-
allowed_hosts: List[str] = [nc.value for nc in NationalClouds]
20+
options: Optional[dict] = {},
21+
scopes: list[str] = [],
22+
allowed_hosts: list[str] = [nc.value for nc in NationalClouds]
2323
) -> None:
2424
"""[summary]
2525
2626
Args:
2727
credentials (Union["TokenCredential", "AsyncTokenCredential"]): The
2828
tokenCredential implementation to use for authentication.
2929
options (Optional[dict]): The options to use for authentication.
30-
scopes (List[str]): The scopes to use for authentication.
30+
scopes (list[str]): The scopes to use for authentication.
3131
Defaults to 'https://<national_cloud_domain>/.default'.
32-
allowed_hosts (Optional[List[str]]): The allowed hosts to use for
32+
allowed_hosts (Optional[list[str]]): The allowed hosts to use for
3333
authentication. Defaults to Microsoft National Clouds.
3434
"""
3535
super().__init__(credentials, options, scopes, allowed_hosts)

src/msgraph_core/base_graph_request_adapter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Optional
2+
23
import httpx
34
from kiota_abstractions.authentication import AuthenticationProvider
45
from kiota_abstractions.serialization import (

src/msgraph_core/graph_client_factory.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ------------------------------------
55
from __future__ import annotations
66

7-
from typing import Dict, List, Optional
7+
from typing import Optional
88

99
import httpx
1010
from kiota_abstractions.request_option import RequestOption
@@ -27,7 +27,7 @@ def create_with_default_middleware( # type: ignore
2727
api_version: APIVersion = APIVersion.v1,
2828
client: Optional[httpx.AsyncClient] = None,
2929
host: NationalClouds = NationalClouds.Global,
30-
options: Optional[Dict[str, RequestOption]] = None
30+
options: Optional[dict[str, RequestOption]] = None
3131
) -> httpx.AsyncClient:
3232
"""Constructs native HTTP AsyncClient(httpx.AsyncClient) instances configured with
3333
a custom transport loaded with a default pipeline of middleware.
@@ -39,8 +39,8 @@ def create_with_default_middleware( # type: ignore
3939
Defaults to KiotaClientFactory.get_default_client().
4040
host (NationalClouds): The national clound endpoint to be used.
4141
Defaults to NationalClouds.Global.
42-
options (Optional[Dict[str, RequestOption]]): The request options to use when
43-
instantiating default middleware. Defaults to Dict[str, RequestOption]=None.
42+
options (Optional[dict[str, RequestOption]]): The request options to use when
43+
instantiating default middleware. Defaults to dict[str, RequestOption]=None.
4444
4545
Returns:
4646
httpx.AsyncClient: An instance of the AsyncClient object
@@ -56,15 +56,15 @@ def create_with_default_middleware( # type: ignore
5656
@staticmethod
5757
def create_with_custom_middleware( # type: ignore
5858
# Breaking change to remove Kiota client factory as base class
59-
middleware: Optional[List[BaseMiddleware]],
59+
middleware: Optional[list[BaseMiddleware]],
6060
api_version: APIVersion = APIVersion.v1,
6161
client: Optional[httpx.AsyncClient] = None,
6262
host: NationalClouds = NationalClouds.Global,
6363
) -> httpx.AsyncClient:
6464
"""Applies a custom middleware chain to the HTTP Client
6565
6666
Args:
67-
middleware(List[BaseMiddleware]): Custom middleware list that will be used to create
67+
middleware(list[BaseMiddleware]): Custom middleware list that will be used to create
6868
a middleware pipeline. The middleware should be arranged in the order in which they will
6969
modify the request.
7070
api_version (APIVersion): The Graph API version to be used.
@@ -87,7 +87,7 @@ def _get_base_url(host: str, api_version: APIVersion) -> str:
8787

8888
@staticmethod
8989
def _get_telemetry_handler(
90-
options: Optional[Dict[str, RequestOption]]
90+
options: Optional[dict[str, RequestOption]]
9191
) -> GraphTelemetryHandler:
9292
"""Helper method to get the graph telemetry handler instantiated with appropriate
9393
options"""
@@ -102,7 +102,7 @@ def _get_telemetry_handler(
102102

103103
@staticmethod
104104
def _load_middleware_to_client(
105-
client: httpx.AsyncClient, middleware: Optional[List[BaseMiddleware]]
105+
client: httpx.AsyncClient, middleware: Optional[list[BaseMiddleware]]
106106
) -> httpx.AsyncClient:
107107
current_transport = client._transport
108108
client._transport = GraphClientFactory._replace_transport_with_custom_graph_transport(
@@ -123,7 +123,7 @@ def _load_middleware_to_client(
123123

124124
@staticmethod
125125
def _replace_transport_with_custom_graph_transport(
126-
current_transport: httpx.AsyncBaseTransport, middleware: Optional[List[BaseMiddleware]]
126+
current_transport: httpx.AsyncBaseTransport, middleware: Optional[list[BaseMiddleware]]
127127
) -> AsyncGraphTransport:
128128
middleware_pipeline = KiotaClientFactory.create_middleware_pipeline(
129129
middleware, current_transport

src/msgraph_core/middleware/options/graph_telemetry_handler_option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import Optional
22

33
from kiota_abstractions.request_option import RequestOption
44

src/msgraph_core/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from .page_result import PageResult
21
from .large_file_upload_session import LargeFileUploadSession
2+
from .page_result import PageResult
33
from .upload_result import UploadResult, UploadSessionDataHolder
44

55
__all__ = ['PageResult', 'LargeFileUploadSession', 'UploadResult', 'UploadSessionDataHolder']

0 commit comments

Comments
 (0)