Skip to content

Commit efe6865

Browse files
committed
Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/packages/http-client-python/multi-8e14e314c6
# Conflicts: # packages/http-client-python/eng/scripts/ci/config/eslint-ci.config.mjs # packages/http-client-python/package-lock.json
2 parents 8b17df5 + 9bd7a5b commit efe6865

12 files changed

Lines changed: 305 additions & 50 deletions

.chronus/changes/fix-python-no-sdk-clients-suppression-2026-09-02.md

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

.chronus/changes/fix-python-playground-bundle-esbuild-2026-9-1-14-15-1.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: dependencies
3+
packages:
4+
- "@typespec/http-client-java"
5+
---
6+
7+
Update transitive Node.js dependencies to address security vulnerabilities.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@typespec/http-client-python"
5+
---
6+
7+
Move Python emitter PR validation into GitHub Actions CI Gate.

.chronus/changes/python-spector-tests-arm-operationtemplates-nextlink-2026-8-19-6-0-0.md

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

.github/workflows/ci-python.yml

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
name: Python CI
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
name: "Build & Regenerate (Linux)"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v7
15+
16+
- uses: ./.github/actions/setup
17+
18+
- uses: actions/setup-python@v7
19+
with:
20+
python-version: "3.12"
21+
22+
- name: Install repo dependencies
23+
run: pnpm install
24+
25+
- name: Setup http-client-python
26+
# Avoid npm lifecycle side effects and lockfile rewrites in CI; setup still runs build + generator install.
27+
run: |
28+
npm install --ignore-scripts --package-lock=false
29+
npm run setup
30+
working-directory: packages/http-client-python
31+
32+
- name: Prepare Python environment
33+
# Run prepare.py directly so missing tox/dev dependencies fail the job instead of being swallowed by the npm wrapper.
34+
run: venv/bin/python eng/scripts/setup/prepare.py
35+
working-directory: packages/http-client-python
36+
37+
- name: Regenerate
38+
run: npm run regenerate
39+
working-directory: packages/http-client-python
40+
41+
- name: Pre-build wheels
42+
run: |
43+
venv/bin/python tests/install_packages.py build azure tests
44+
venv/bin/python tests/install_packages.py build unbranded tests
45+
working-directory: packages/http-client-python
46+
47+
- name: Check for unstaged changes
48+
run: npm run check-unstaged
49+
working-directory: packages/http-client-python
50+
51+
- name: Upload generated artifacts
52+
uses: actions/upload-artifact@v7
53+
with:
54+
name: python-generated
55+
include-hidden-files: true
56+
path: |
57+
packages/http-client-python/tests/generated
58+
packages/http-client-python/tests/.wheels
59+
packages/http-client-python/dist
60+
packages/http-client-python/generator/dist
61+
retention-days: 1
62+
63+
test:
64+
name: "Mock API Tests"
65+
needs: build
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v7
69+
70+
- uses: ./.github/actions/setup
71+
72+
- uses: actions/setup-python@v7
73+
with:
74+
python-version: "3.12"
75+
76+
- name: Download generated artifacts
77+
uses: actions/download-artifact@v8
78+
with:
79+
name: python-generated
80+
path: packages/http-client-python
81+
82+
- name: Install repo dependencies
83+
run: pnpm install
84+
85+
- name: Setup http-client-python
86+
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
87+
run: |
88+
npm install --ignore-scripts --package-lock=false
89+
npm run install
90+
venv/bin/python eng/scripts/setup/prepare.py
91+
working-directory: packages/http-client-python
92+
93+
- name: Test
94+
run: npm run test:generator -- --env=test
95+
working-directory: packages/http-client-python
96+
97+
typecheck:
98+
name: "Type Checking"
99+
needs: build
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@v7
103+
104+
- uses: ./.github/actions/setup
105+
106+
- uses: actions/setup-python@v7
107+
with:
108+
python-version: "3.12"
109+
110+
- name: Download generated artifacts
111+
uses: actions/download-artifact@v8
112+
with:
113+
name: python-generated
114+
path: packages/http-client-python
115+
116+
- name: Install repo dependencies
117+
run: pnpm install
118+
119+
- name: Setup http-client-python
120+
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
121+
run: |
122+
npm install --ignore-scripts --package-lock=false
123+
npm run install
124+
venv/bin/python eng/scripts/setup/prepare.py
125+
working-directory: packages/http-client-python
126+
127+
- name: Mypy & Pyright
128+
run: npm run test:generator -- --env=mypy,pyright
129+
working-directory: packages/http-client-python
130+
131+
lint:
132+
name: "Lint & Format"
133+
needs: build
134+
runs-on: ubuntu-latest
135+
steps:
136+
- uses: actions/checkout@v7
137+
138+
- uses: ./.github/actions/setup
139+
140+
- uses: actions/setup-python@v7
141+
with:
142+
python-version: "3.12"
143+
144+
- name: Download generated artifacts
145+
uses: actions/download-artifact@v8
146+
with:
147+
name: python-generated
148+
path: packages/http-client-python
149+
150+
- name: Install repo dependencies
151+
run: pnpm install
152+
153+
- name: Setup http-client-python
154+
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
155+
run: |
156+
npm install --ignore-scripts --package-lock=false
157+
npm run install
158+
venv/bin/python eng/scripts/setup/prepare.py
159+
working-directory: packages/http-client-python
160+
161+
- name: Pylint
162+
run: npm run test:generator -- --env=lint
163+
working-directory: packages/http-client-python
164+
165+
- name: Lint source
166+
run: npm run lint
167+
working-directory: packages/http-client-python
168+
169+
- name: Build TypeSpec Prettier plugin
170+
run: pnpm --filter "@typespec/prettier-plugin-typespec..." run build
171+
172+
- name: Format check source
173+
run: npm run format:check
174+
working-directory: packages/http-client-python
175+
176+
docs:
177+
name: "Docs Validation"
178+
needs: build
179+
runs-on: ubuntu-latest
180+
steps:
181+
- uses: actions/checkout@v7
182+
183+
- uses: ./.github/actions/setup
184+
185+
- uses: actions/setup-python@v7
186+
with:
187+
python-version: "3.12"
188+
189+
- name: Download generated artifacts
190+
uses: actions/download-artifact@v8
191+
with:
192+
name: python-generated
193+
path: packages/http-client-python
194+
195+
- name: Install repo dependencies
196+
run: pnpm install
197+
198+
- name: Setup http-client-python
199+
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
200+
run: |
201+
npm install --ignore-scripts --package-lock=false
202+
npm run install
203+
venv/bin/python eng/scripts/setup/prepare.py
204+
working-directory: packages/http-client-python
205+
206+
- name: API View & Sphinx
207+
run: npm run test:generator -- --env=apiview,sphinx
208+
working-directory: packages/http-client-python
209+
210+
windows-test:
211+
name: "Build & Regenerate && Test (Windows)"
212+
runs-on: windows-latest
213+
steps:
214+
- name: Enable Git long paths
215+
run: git config --system core.longpaths true
216+
217+
- uses: actions/checkout@v7
218+
219+
- uses: ./.github/actions/setup
220+
221+
- uses: actions/setup-python@v7
222+
with:
223+
python-version: "3.12"
224+
225+
- name: Install repo dependencies
226+
run: pnpm install
227+
228+
- name: Setup http-client-python
229+
# Windows validates build/regenerate/test in one job, so run the full setup instead of restoring Linux artifacts.
230+
run: |
231+
npm install --ignore-scripts --package-lock=false
232+
npm run setup
233+
.\venv\Scripts\python.exe eng\scripts\setup\prepare.py
234+
working-directory: packages/http-client-python
235+
236+
- name: Regenerate
237+
run: npm run regenerate
238+
working-directory: packages/http-client-python
239+
240+
- name: Test
241+
run: npm run test:generator -- --env=test
242+
working-directory: packages/http-client-python

.github/workflows/ci.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
permissions:
1414
contents: read
15+
pull-requests: read
1516

1617
concurrency:
1718
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,12 +23,13 @@ jobs:
2223
name: Detect Changes
2324
runs-on: ubuntu-slim
2425
outputs:
25-
core: ${{ steps.filter.outputs.core }}
26+
core: ${{ steps.core-filter.outputs.core }}
27+
python: ${{ steps.python-filter.outputs.python }}
2628
steps:
2729
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2830
# cspell:ignore dorny
2931
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
30-
id: filter
32+
id: core-filter
3133
with:
3234
predicate-quantifier: "every"
3335
filters: |
@@ -42,22 +44,39 @@ jobs:
4244
- '!packages/http-client-csharp/**'
4345
- '!packages/http-client-java/**'
4446
- '!packages/http-client-python/**'
47+
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
48+
id: python-filter
49+
with:
50+
filters: |
51+
python:
52+
- 'packages/http-client-python/**'
53+
- '.github/workflows/ci.yml'
54+
- '.github/workflows/ci-python.yml'
4555
4656
core:
4757
needs: changes
4858
if: needs.changes.outputs.core == 'true'
4959
uses: ./.github/workflows/core-ci.yml
5060

61+
python:
62+
needs: changes
63+
if: needs.changes.outputs.python == 'true'
64+
uses: ./.github/workflows/ci-python.yml
65+
5166
ci-gate:
5267
name: CI Gate
5368
runs-on: ubuntu-slim
54-
if: "!cancelled() || needs.core.result == 'cancelled'"
55-
needs: [core]
69+
if: "!cancelled() || contains(needs.*.result, 'cancelled')"
70+
needs: [core, python]
5671
steps:
5772
- name: Validate CI results
5873
run: |
5974
if [[ "${{ needs.core.result }}" == "failure" || "${{ needs.core.result }}" == "cancelled" ]]; then
6075
echo "Core CI failed or was cancelled"
6176
exit 1
6277
fi
78+
if [[ "${{ needs.python.result }}" == "failure" || "${{ needs.python.result }}" == "cancelled" ]]; then
79+
echo "Python CI failed or was cancelled"
80+
exit 1
81+
fi
6382
echo "All CI checks passed or were appropriately skipped"

eng/common/pipelines/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,3 @@ extends:
5555
parameters:
5656
DependsOn: InitStage
5757
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunJava'])
58-
59-
# Run python stages if RunPython == true
60-
- template: /packages/http-client-python/eng/pipeline/templates/ci-stages.yml
61-
parameters:
62-
DependsOn: InitStage
63-
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunPython'])

packages/http-client-java/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)