Skip to content

Commit 32ac61e

Browse files
Merge branch 'main' into bugfix/large-file-upload-typeerror
2 parents 4e04a12 + d6e481a commit 32ac61e

11 files changed

Lines changed: 187 additions & 64 deletions

File tree

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Build, package, and deploy msgraph-sdk-python-core to PyPI.
5+
6+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
7+
8+
trigger:
9+
tags:
10+
include:
11+
- "v*"
12+
13+
pr: none
14+
15+
variables:
16+
pythonVersion: "3.14"
17+
18+
resources:
19+
repositories:
20+
- repository: 1ESPipelineTemplates
21+
type: git
22+
name: 1ESPipelineTemplates/1ESPipelineTemplates
23+
ref: refs/tags/release
24+
25+
extends:
26+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
27+
parameters:
28+
pool:
29+
name: Azure-Pipelines-1ESPT-ExDShared
30+
image: ubuntu-latest
31+
os: linux
32+
sdl:
33+
sourceAnalysisPool:
34+
name: Azure-Pipelines-1ESPT-ExDShared
35+
image: windows-2022
36+
os: windows
37+
stages:
38+
- stage: build
39+
displayName: "Build and Package msgraph-sdk-python-core"
40+
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Manual'))
41+
jobs:
42+
- job: build_python
43+
displayName: "Build, Test, and Package"
44+
pool:
45+
name: Azure-Pipelines-1ESPT-ExDShared
46+
image: ubuntu-latest
47+
os: linux
48+
steps:
49+
- checkout: self
50+
51+
- task: UsePythonVersion@0
52+
displayName: "Install Python $(pythonVersion)"
53+
inputs:
54+
versionSpec: "$(pythonVersion)"
55+
addToPath: true
56+
57+
- script: python -m pip install --upgrade pip
58+
displayName: "Upgrade pip"
59+
60+
- task: PipAuthenticate@1
61+
displayName: "Authenticate pip to Azure Artifacts"
62+
inputs:
63+
artifactFeeds: "$(System.TeamProject)/GraphDeveloperExperiences_Public"
64+
65+
- script: pip install -r requirements-dev.txt
66+
displayName: "Install dependencies"
67+
68+
- script: yapf -dr src
69+
displayName: "Check code format"
70+
71+
- script: isort src
72+
displayName: "Check import order"
73+
74+
- script: mypy src
75+
displayName: "Static type checking with Mypy"
76+
77+
- script: pylint src --disable=W --rcfile=.pylintrc
78+
displayName: "Lint with Pylint"
79+
80+
- script: pytest
81+
displayName: "Run unit tests"
82+
83+
- script: pip install build
84+
displayName: "Install package builder"
85+
86+
- script: python -m build
87+
displayName: "Build package artifacts"
88+
89+
- task: CopyFiles@2
90+
displayName: "Copy package artifacts to staging"
91+
inputs:
92+
CleanTargetFolder: true
93+
sourceFolder: "$(Build.SourcesDirectory)"
94+
targetFolder: "$(Build.ArtifactStagingDirectory)/python/msgraph_core"
95+
Contents: |
96+
dist/*.tar.gz
97+
dist/*.whl
98+
flattenFolders: true
99+
100+
templateContext:
101+
outputs:
102+
- output: pipelineArtifact
103+
displayName: "Stage msgraph-core package artifacts"
104+
artifactName: pypi_msgraph_core_package
105+
targetPath: "$(Build.ArtifactStagingDirectory)/python/msgraph_core"
106+
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Manual'))
107+
108+
- stage: deploy
109+
displayName: "Publish msgraph-sdk-python-core to PyPI"
110+
dependsOn: build
111+
condition: or(and(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), succeeded()), eq(variables['Build.Reason'], 'Manual'))
112+
jobs:
113+
- deployment: publish_python_package
114+
displayName: "Publish msgraph-core package"
115+
environment: pypi_prod
116+
pool:
117+
name: Azure-Pipelines-1ESPT-ExDShared
118+
image: ubuntu-latest
119+
os: linux
120+
templateContext:
121+
type: releaseJob
122+
isProduction: true
123+
inputs:
124+
- input: pipelineArtifact
125+
artifactName: pypi_msgraph_core_package
126+
targetPath: "$(Build.ArtifactStagingDirectory)/python"
127+
strategy:
128+
runOnce:
129+
deploy:
130+
steps:
131+
- task: EsrpRelease@9
132+
displayName: "Publish msgraph-core package via ESRP Release"
133+
inputs:
134+
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
135+
usemanagedidentity: false
136+
keyvaultname: "akv-prod-eastus"
137+
authcertname: "ReferenceLibraryPrivateCert"
138+
signcertname: "ReferencePackagePublisherCertificate"
139+
clientid: "65035b7f-7357-4f29-bf25-c5ee5c3949f8"
140+
intent: "PackageDistribution"
141+
contenttype: "PYPI"
142+
contentsource: "Folder"
143+
folderlocation: "$(Build.ArtifactStagingDirectory)/python"
144+
waitforreleasecompletion: true
145+
owners: "mmainer@microsoft.com,gavinbarron@microsoft.com"
146+
approvers: "mmainer@microsoft.com,christiano@microsoft.com,gavinbarron@microsoft.com"
147+
serviceendpointurl: "https://api.esrp.microsoft.com"
148+
mainpublisher: "ESRPRELPACMAN"
149+
domaintenantid: "cdc5aeea-15c5-4db6-b079-fcadd2505dc2"

.azure-pipelines/daily-ci-build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extends:
2121
parameters:
2222
pool:
2323
name: Azure-Pipelines-1ESPT-ExDShared
24+
image: ubuntu-latest
2425
os: linux
2526
sdl:
2627
sourceAnalysisPool:
@@ -47,11 +48,17 @@ extends:
4748
inputs:
4849
versionSpec: '3.12'
4950

51+
- task: PipAuthenticate@1
52+
displayName: Authenticate with Azure Artifacts
53+
inputs:
54+
artifactFeeds: Graph Developer Experiences/GraphDeveloperExperiences_Public
55+
onlyAddExtraIndex: false
56+
5057
- script: python -m pip install --upgrade pip
5158
displayName: Upgrade pip
5259
workingDirectory: $(Build.SourcesDirectory)
5360

54-
- script: pip install -e ".[dev]"
61+
- script: pip install -r requirements-dev.txt
5562
displayName: Install dependencies
5663
workingDirectory: $(Build.SourcesDirectory)
5764

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2121

2222
steps:
23-
- uses: actions/checkout@v6
23+
- uses: actions/checkout@v7
2424
- name: Set up Python ${{ matrix.python-version }}
2525
uses: actions/setup-python@v6
2626
with:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v6
39+
uses: actions/checkout@v7
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL

.github/workflows/publish.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/release-please-gha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
release:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@v7
2323

2424
- name: Generate GitHub App token
2525
id: app-token

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"tests"
55
],
66
"python.testing.unittestEnabled": false,
7-
"python.testing.pytestEnabled": true
7+
"python.testing.pytestEnabled": true,
8+
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true
89
}

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ version = "1.4.0"
1111
authors = [{name = "Microsoft", email = "graphtooling+python@microsoft.com"}]
1212
description = "Core component of the Microsoft Graph Python SDK"
1313
dependencies = [
14-
"microsoft-kiota-abstractions >=1.10.1,<2.0.0",
15-
"microsoft-kiota-authentication-azure >=1.10.1,<2.0.0",
16-
"microsoft-kiota-http >=1.10.1,<2.0.0",
14+
"microsoft-kiota-abstractions >=1.11.6,<2.0.0",
15+
"microsoft-kiota-authentication-azure >=1.11.6,<2.0.0",
16+
"microsoft-kiota-http >=1.11.6,<2.0.0",
1717
"httpx[http2] >=0.23.0",
1818
]
1919
requires-python = ">=3.10"

requirements-dev.txt

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
-i https://pypi.org/simple
21

32
async-generator==1.10 ; python_version >= '3.5'
43

54
asyncmock==0.4.2
65

7-
attrs==25.3.0 ; python_version >= '3.7'
6+
attrs==26.1.0 ; python_version >= '3.7'
87

98
azure-core==1.41.0 ; python_version >= '3.7'
109

@@ -18,19 +17,19 @@ certifi==2025.8.3 ; python_version >= '3.6'
1817

1918
cffi==1.17.1 ; os_name == 'nt' and implementation_name != 'pypy'
2019

21-
charset-normalizer==3.4.3 ; python_full_version >= '3.7.0'
20+
charset-normalizer==3.4.7 ; python_full_version >= '3.7.0'
2221

2322
click==8.1.8 ; python_version >= '3.6'
2423

2524
colorama==0.4.6 ; os_name == 'nt'
2625

27-
coverage[toml]==7.10.6 ; python_version >= '3.7'
26+
coverage[toml]==7.14.1 ; python_version >= '3.7'
2827

29-
cryptography==46.0.7 ; python_version >= '3.7'
28+
cryptography==48.0.1 ; python_version >= '3.7'
3029

31-
dill==0.4.0 ; python_version < '3.11'
30+
dill==0.4.1
3231

33-
exceptiongroup==1.3.0 ; python_version < '3.11'
32+
exceptiongroup==1.3.1 ; python_version < '3.11'
3433

3534
idna==3.15 ; python_version >= '3.5'
3635

@@ -72,7 +71,7 @@ portalocker==2.10.1 ; python_version >= '3.5' and platform_system == 'Windows'
7271

7372
pycparser==2.23
7473

75-
pyjwt[crypto]==2.12.0 ; python_version >= '3.7'
74+
pyjwt[crypto]==2.13.0 ; python_version >= '3.7'
7675

7776
pylint==4.0.5
7877

@@ -108,26 +107,26 @@ tomli==2.2.1 ; python_version < '3.11'
108107

109108
tomlkit==0.13.3 ; python_version >= '3.7'
110109

111-
trio==0.31.0
110+
trio==0.33.0
112111

113112
types-python-dateutil==2.9.0.20260518
114113

115-
types-requests==2.32.4.20250809; python_version >= '3.7'
114+
types-requests==2.33.0.20260518; python_version >= '3.7'
116115
urllib3==2.7.0 ; python_version >= '3.7'
117116
typing-extensions==4.15.0 ; python_version >= '3.7'
118117

119118

120-
wrapt==1.17.3 ; python_version < '3.11'
119+
wrapt==1.17.3
121120

122121
yapf==0.43.0
123122

124123
zipp==4.1.0 ; python_version >= '3.7'
125124

126-
aiohttp==3.13.5 ; python_version >= '3.6'
125+
aiohttp==3.14.1 ; python_version >= '3.6'
127126

128127
aiosignal==1.4.0 ; python_version >= '3.7'
129128

130-
anyio==4.10.0 ; python_version >= '3.7'
129+
anyio==4.13.0 ; python_version >= '3.7'
131130

132131
async-timeout==5.0.1 ; python_version >= '3.6'
133132

@@ -145,15 +144,15 @@ httpx[http2]==0.28.1
145144

146145
hyperframe==6.1.0 ; python_full_version >= '3.6.1'
147146

148-
microsoft-kiota-abstractions==1.10.1
147+
microsoft-kiota-abstractions==1.11.6
149148

150-
microsoft-kiota-authentication-azure==1.10.1
149+
microsoft-kiota-authentication-azure==1.11.6
151150

152-
microsoft-kiota-http==1.10.1
151+
microsoft-kiota-http==1.11.6
153152

154-
microsoft-kiota-serialization-json==1.10.1
153+
microsoft-kiota-serialization-json==1.11.6
155154

156-
multidict==6.6.4 ; python_version >= '3.7'
155+
multidict==6.7.1 ; python_version >= '3.7'
157156

158157
uritemplate==4.2.0 ; python_version >= '3.6'
159158

src/msgraph_core/middleware/telemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _add_host_os_header(self, request) -> None:
115115
"""
116116
system = platform.system()
117117
version = platform.version()
118-
host_os = f'{system} {version}'
118+
host_os = f'{system} {version}'.strip()
119119
request.headers.update({'HostOs': host_os})
120120

121121
def _add_runtime_environment_header(self, request) -> None:

0 commit comments

Comments
 (0)