Skip to content

Commit d9ada2d

Browse files
Merge branch 'main' into fix/feature-usage-flag-intflag-str
2 parents f26541b + d6e481a commit d9ada2d

18 files changed

Lines changed: 230 additions & 101 deletions
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

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
{
44
"name": "Python 3",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
// "image": "mcr.microsoft.com/devcontainers/python:3.9-bookworm",
76
// "image": "mcr.microsoft.com/devcontainers/python:3.10-bookworm",
87
// "image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm",
98
// "image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
109
// "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
1110
// "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
12-
"image": "mcr.microsoft.com/devcontainers/python:3.13-bullseye",
11+
"image": "mcr.microsoft.com/devcontainers/python:3.14-bookworm",
1312

1413
"features": {
1514
"ghcr.io/hspaans/devcontainer-features/pytest:1": {},

.github/workflows/auto-merge-dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- name: Dependabot metadata
1919
id: metadata
20-
uses: dependabot/fetch-metadata@v2.4.0
20+
uses: dependabot/fetch-metadata@v3.1.0
2121
with:
2222
github-token: "${{ secrets.GITHUB_TOKEN }}"
2323

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
strategy:
1818
max-parallel: 5
1919
matrix:
20-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2121

2222
steps:
23-
- uses: actions/checkout@v5
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636

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

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v3
43+
uses: github/codeql-action/init@v4
4444
with:
4545
languages: ${{ matrix.language }}
4646
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
56+
uses: github/codeql-action/autobuild@v4
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -66,4 +66,4 @@ jobs:
6666
# ./location_of_script_within_repo/buildscript.sh
6767

6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v3
69+
uses: github/codeql-action/analyze@v4

.github/workflows/project-auto-add.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Generate token
2020
id: generate_token
21-
uses: actions/create-github-app-token@v2
21+
uses: actions/create-github-app-token@v3
2222
with:
2323
app-id: ${{ secrets.GRAPHBOT_APP_ID }}
2424
private-key: ${{ secrets.GRAPHBOT_APP_PEM }}

.github/workflows/publish.yml

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ jobs:
1919
release:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v7
2323

2424
- name: Generate GitHub App token
2525
id: app-token
26-
uses: actions/create-github-app-token@v2
26+
uses: actions/create-github-app-token@v3
2727
with:
2828
app-id: ${{ vars.RELEASE_PLEASE_TOKEN_PROVIDER_APP_ID }}
2929
private-key: ${{ secrets.RELEASE_PLEASE_TOKEN_PROVIDER_PEM }}
3030

3131
- name: Release Please
32-
uses: googleapis/release-please-action@v4
32+
uses: googleapis/release-please-action@v5
3333
with:
3434
token: ${{ steps.app-token.outputs.token }}
3535
config-file: release-please-config.json

.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.3.8"
2+
".": "1.4.0"
33
}

0 commit comments

Comments
 (0)