Skip to content

Commit dd1a4e1

Browse files
author
Andrew Omondi
committed
Merge remote-tracking branch 'origin/main' into add-python-3.13-support
2 parents d4c3ae1 + 471018e commit dd1a4e1

11 files changed

+38
-20
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.2.0"
2+
".": "1.2.1"
33
}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.2.1](https://github.com/microsoftgraph/msgraph-sdk-python-core/compare/v1.2.0...v1.2.1) (2025-01-30)
6+
7+
8+
### Bug Fixes
9+
10+
* issue with national cloud/version enums and base url being set [#818](https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/818) ([4ee7887](https://github.com/microsoftgraph/msgraph-sdk-python-core/commit/4ee78873cfe176c38e84c4f1d7f469c73eb6dff6))
11+
512
## [1.2.0](https://github.com/microsoftgraph/msgraph-sdk-python-core/compare/v1.1.8...v1.2.0) (2025-01-14)
613

714

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "msgraph-core"
77
# The SDK version
88
# x-release-please-start-version
9-
version = "1.2.0"
9+
version = "1.2.1"
1010
# x-release-please-end
1111
authors = [{name = "Microsoft", email = "[email protected]"}]
1212
description = "Core component of the Microsoft Graph Python SDK"

requirements-dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build==1.2.2.post1
1414

1515
bumpver==2024.1130
1616

17-
certifi==2024.12.14 ; python_version >= '3.6'
17+
certifi==2025.1.31 ; python_version >= '3.6'
1818

1919
cffi==1.17.1 ; os_name == 'nt' and implementation_name != 'pypy'
2020

@@ -135,7 +135,7 @@ frozenlist==1.5.0 ; python_version >= '3.7'
135135

136136
h11==0.14.0 ; python_version >= '3.7'
137137

138-
h2==4.1.0
138+
h2==4.2.0
139139

140140
hpack==4.1.0 ; python_full_version >= '3.6.1'
141141

@@ -145,11 +145,11 @@ httpx[http2]==0.28.1
145145

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

148-
microsoft-kiota-abstractions==1.9.0
148+
microsoft-kiota-abstractions==1.9.1
149149

150-
microsoft-kiota-authentication-azure==1.9.0
150+
microsoft-kiota-authentication-azure==1.9.1
151151

152-
microsoft-kiota-http==1.9.0
152+
microsoft-kiota-http==1.9.1
153153

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

src/msgraph_core/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
DEFAULT_CONNECTION_TIMEOUT = 30
1111
# The SDK version
1212
# x-release-please-start-version
13-
SDK_VERSION = '1.2.0'
13+
SDK_VERSION = '1.2.1'
1414
# x-release-please-end
1515
MS_DEFAULT_SCOPE = 'https://graph.microsoft.com/.default'

src/msgraph_core/_enums.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class APIVersion(str, Enum):
1212
beta = 'beta'
1313
v1 = 'v1.0'
1414

15+
def __str__(self):
16+
return self.value
17+
1518

1619
class FeatureUsageFlag(int, Enum):
1720
"""Enumerated list of values used to flag usage of specific middleware"""
@@ -23,6 +26,9 @@ class FeatureUsageFlag(int, Enum):
2326
DEFAULT_HTTP_PROVIDER_ENABLED = 8
2427
LOGGING_HANDLER_ENABLED = 16
2528

29+
def __str__(self):
30+
return self.value
31+
2632

2733
class NationalClouds(str, Enum):
2834
"""Enumerated list of supported sovereign clouds"""
@@ -32,3 +38,6 @@ class NationalClouds(str, Enum):
3238
Global = 'https://graph.microsoft.com'
3339
US_DoD = 'https://dod-graph.microsoft.us'
3440
US_GOV = 'https://graph.microsoft.us'
41+
42+
def __str__(self):
43+
return self.value

src/msgraph_core/requests/batch_request_item.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import re
55
import urllib.request
6+
from deprecated import deprecated
67
from io import BytesIO
78
from typing import Any, Optional, Union
89
from urllib.parse import urlparse
@@ -14,6 +15,7 @@
1415
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
1516

1617

18+
@deprecated("Use BytesIO type instead")
1719
class StreamInterface(BytesIO):
1820
pass
1921

tests/requests/test_batch_request_content.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import pytest
2+
from io import BytesIO
23
from unittest.mock import Mock
34
from urllib.request import Request
45
from kiota_abstractions.request_information import RequestInformation
56
from kiota_abstractions.serialization import SerializationWriter
67
from msgraph_core.requests.batch_request_item import BatchRequestItem
78
from msgraph_core.requests.batch_request_content import BatchRequestContent
89
from kiota_abstractions.headers_collection import HeadersCollection as RequestHeaders
9-
from msgraph_core.requests.batch_request_item import BatchRequestItem, StreamInterface
10+
from msgraph_core.requests.batch_request_item import BatchRequestItem
1011

1112

1213
@pytest.fixture
@@ -16,7 +17,7 @@ def request_info1():
1617
request_info.url = "https://graph.microsoft.com/v1.0/me"
1718
request_info.headers = RequestHeaders()
1819
request_info.headers.add("Content-Type", "application/json")
19-
request_info.content = StreamInterface(b'{"key": "value"}')
20+
request_info.content = BytesIO(b'{"key": "value"}')
2021
return request_info
2122

2223

@@ -27,7 +28,7 @@ def request_info2():
2728
request_info.url = "https://graph.microsoft.com/v1.0/users"
2829
request_info.headers = RequestHeaders()
2930
request_info.headers.add("Content-Type", "application/json")
30-
request_info.content = StreamInterface(b'{"key": "value"}')
31+
request_info.content = BytesIO(b'{"key": "value"}')
3132
return request_info
3233

3334

tests/requests/test_batch_request_item.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import pytest
2-
from unittest.mock import Mock
2+
from io import BytesIO
33
from urllib.request import Request
44
from kiota_abstractions.request_information import RequestInformation
55
from kiota_abstractions.method import Method
66
from kiota_abstractions.headers_collection import HeadersCollection as RequestHeaders
7-
from msgraph_core.requests.batch_request_item import BatchRequestItem, StreamInterface
8-
from kiota_abstractions.serialization import SerializationWriter
7+
from msgraph_core.requests.batch_request_item import BatchRequestItem
98

109
base_url = "https://graph.microsoft.com/v1.0/me"
1110

@@ -16,7 +15,7 @@ def request_info():
1615
request_info.http_method = "GET"
1716
request_info.url = "f{base_url}/me"
1817
request_info.headers = RequestHeaders()
19-
request_info.content = StreamInterface(b'{"key": "value"}')
18+
request_info.content = BytesIO(b'{"key": "value"}')
2019
return request_info
2120

2221

@@ -100,7 +99,7 @@ def test_headers_property(batch_request_item):
10099

101100

102101
def test_body_property(batch_request_item):
103-
new_body = StreamInterface(b'{"new_key": "new_value"}')
102+
new_body = BytesIO(b'{"new_key": "new_value"}')
104103
batch_request_item.body = new_body
105104
assert batch_request_item.body == b'{"new_key": "new_value"}'
106105

tests/requests/test_batch_response_item.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from kiota_abstractions.serialization import ParseNode, SerializationWriter
55
from unittest.mock import Mock
66

7-
from msgraph_core.requests.batch_response_item import BatchResponseItem, StreamInterface
7+
from msgraph_core.requests.batch_response_item import BatchResponseItem
88

99

1010
@pytest.fixture
@@ -42,7 +42,7 @@ def test_headers_property(batch_response_item):
4242

4343

4444
def test_body_property(batch_response_item):
45-
body = StreamInterface(b"response body")
45+
body = BytesIO(b"response body")
4646
batch_response_item.body = body
4747
assert batch_response_item.body == body
4848

@@ -74,7 +74,7 @@ def test_serialize(batch_response_item):
7474
batch_response_item.atomicity_group = "group1"
7575
batch_response_item.status = 200
7676
batch_response_item.headers = {"Content-Type": "application/json"}
77-
batch_response_item.body = StreamInterface(b"response body")
77+
batch_response_item.body = BytesIO(b"response body")
7878
batch_response_item.serialize(writer)
7979
writer.write_str_value.assert_any_call('id', "12345")
8080
writer.write_str_value.assert_any_call('atomicity_group', "group1")

0 commit comments

Comments
 (0)