Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e1b262e
ci: migrate Python checks to CI Gate
msyyc Aug 3, 2026
6cdf761
ci: share Python workflow template
msyyc Aug 3, 2026
c126768
ci: keep Python CI wrappers distinct
msyyc Aug 3, 2026
b0d6b2f
ci: fix Python workflow gating
msyyc Aug 3, 2026
62cde21
ci: use local Python setup for Python CI
msyyc Aug 3, 2026
6e9597f
ci: simplify Python CI workflow
msyyc Aug 3, 2026
295e2f0
ci: add standalone Python CI Gate workflow
msyyc Aug 3, 2026
60c7525
ci: avoid Python CI lockfile mutation
msyyc Aug 3, 2026
9fa8055
ci: prepare Python test environment
msyyc Aug 4, 2026
524568e
ci: align Python CI setup with integration flow
msyyc Aug 4, 2026
2b191d9
ci: run Windows Python build and test together
msyyc Aug 4, 2026
021600f
ci: upload Python wheel artifacts
msyyc Aug 4, 2026
21f0f56
ci: restore Python artifacts into package path
msyyc Aug 4, 2026
cff9838
ci: declare Python ESLint dependencies
msyyc Aug 4, 2026
a3a70d1
ci: isolate Python formatter config
msyyc Aug 4, 2026
fbec5e5
ci: build Prettier plugin for Python format check
msyyc Aug 4, 2026
9c8dab7
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 4, 2026
afdc2d8
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 6, 2026
bd6ee4e
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 7, 2026
6a01435
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 10, 2026
b206434
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 24, 2026
03d4e86
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 26, 2026
cb3bc1f
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Aug 31, 2026
164468a
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Sep 1, 2026
0f4953a
Merge branch 'main' into msyyc-migrate-python-ci-gate
msyyc Sep 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/python-ci-gate-2026-08-04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-python"
---

Move Python emitter PR validation into GitHub Actions CI Gate.
242 changes: 242 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
name: Python CI

on:
workflow_call:

permissions:
contents: read

jobs:
build:
name: "Build & Regenerate (Linux)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
Comment thread
msyyc marked this conversation as resolved.
with:
python-version: "3.12"

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Avoid npm lifecycle side effects and lockfile rewrites in CI; setup still runs build + generator install.
run: |
npm install --ignore-scripts --package-lock=false
npm run setup
working-directory: packages/http-client-python

- name: Prepare Python environment
# Run prepare.py directly so missing tox/dev dependencies fail the job instead of being swallowed by the npm wrapper.
run: venv/bin/python eng/scripts/setup/prepare.py
working-directory: packages/http-client-python

- name: Regenerate
run: npm run regenerate
working-directory: packages/http-client-python

- name: Pre-build wheels
run: |
venv/bin/python tests/install_packages.py build azure tests
venv/bin/python tests/install_packages.py build unbranded tests
working-directory: packages/http-client-python

- name: Check for unstaged changes
run: npm run check-unstaged
working-directory: packages/http-client-python

- name: Upload generated artifacts
uses: actions/upload-artifact@v7
with:
name: python-generated
include-hidden-files: true
path: |
packages/http-client-python/tests/generated
packages/http-client-python/tests/.wheels
packages/http-client-python/dist
packages/http-client-python/generator/dist
retention-days: 1

test:
name: "Mock API Tests"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Download generated artifacts
uses: actions/download-artifact@v8
with:
name: python-generated
path: packages/http-client-python

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
npm install --ignore-scripts --package-lock=false
npm run install
venv/bin/python eng/scripts/setup/prepare.py
working-directory: packages/http-client-python

- name: Test
run: npm run test:generator -- --env=test
working-directory: packages/http-client-python

typecheck:
name: "Type Checking"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Download generated artifacts
uses: actions/download-artifact@v8
with:
name: python-generated
path: packages/http-client-python

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
npm install --ignore-scripts --package-lock=false
npm run install
venv/bin/python eng/scripts/setup/prepare.py
working-directory: packages/http-client-python

- name: Mypy & Pyright
run: npm run test:generator -- --env=mypy,pyright
working-directory: packages/http-client-python

lint:
name: "Lint & Format"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Download generated artifacts
uses: actions/download-artifact@v8
with:
name: python-generated
path: packages/http-client-python

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
npm install --ignore-scripts --package-lock=false
npm run install
venv/bin/python eng/scripts/setup/prepare.py
working-directory: packages/http-client-python

- name: Pylint
run: npm run test:generator -- --env=lint
working-directory: packages/http-client-python

- name: Lint source
run: npm run lint
working-directory: packages/http-client-python

- name: Build TypeSpec Prettier plugin
run: pnpm --filter "@typespec/prettier-plugin-typespec..." run build

- name: Format check source
run: npm run format:check
working-directory: packages/http-client-python

docs:
name: "Docs Validation"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Download generated artifacts
uses: actions/download-artifact@v8
with:
name: python-generated
path: packages/http-client-python

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
npm install --ignore-scripts --package-lock=false
npm run install
venv/bin/python eng/scripts/setup/prepare.py
working-directory: packages/http-client-python

- name: API View & Sphinx
run: npm run test:generator -- --env=apiview,sphinx
working-directory: packages/http-client-python

windows-test:
name: "Build & Regenerate && Test (Windows)"
runs-on: windows-latest
steps:
- name: Enable Git long paths
run: git config --system core.longpaths true

- uses: actions/checkout@v7

- uses: ./.github/actions/setup

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Install repo dependencies
run: pnpm install

- name: Setup http-client-python
# Windows validates build/regenerate/test in one job, so run the full setup instead of restoring Linux artifacts.
run: |
npm install --ignore-scripts --package-lock=false
npm run setup
.\venv\Scripts\python.exe eng\scripts\setup\prepare.py
working-directory: packages/http-client-python

- name: Regenerate
run: npm run regenerate
working-directory: packages/http-client-python

- name: Test
run: npm run test:generator -- --env=test
working-directory: packages/http-client-python
27 changes: 23 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

permissions:
contents: read
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -22,12 +23,13 @@ jobs:
name: Detect Changes
runs-on: ubuntu-slim
outputs:
core: ${{ steps.filter.outputs.core }}
core: ${{ steps.core-filter.outputs.core }}
python: ${{ steps.python-filter.outputs.python }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# cspell:ignore dorny
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
id: core-filter
Comment thread
msyyc marked this conversation as resolved.
with:
predicate-quantifier: "every"
filters: |
Expand All @@ -42,22 +44,39 @@ jobs:
- '!packages/http-client-csharp/**'
- '!packages/http-client-java/**'
- '!packages/http-client-python/**'
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: python-filter
with:
filters: |
python:
- 'packages/http-client-python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/ci-python.yml'

core:
needs: changes
if: needs.changes.outputs.core == 'true'
uses: ./.github/workflows/core-ci.yml

python:
needs: changes
if: needs.changes.outputs.python == 'true'
uses: ./.github/workflows/ci-python.yml

ci-gate:
name: CI Gate
runs-on: ubuntu-slim
if: "!cancelled() || needs.core.result == 'cancelled'"
needs: [core]
if: "!cancelled() || contains(needs.*.result, 'cancelled')"
needs: [core, python]
steps:
- name: Validate CI results
run: |
if [[ "${{ needs.core.result }}" == "failure" || "${{ needs.core.result }}" == "cancelled" ]]; then
echo "Core CI failed or was cancelled"
exit 1
fi
if [[ "${{ needs.python.result }}" == "failure" || "${{ needs.python.result }}" == "cancelled" ]]; then
echo "Python CI failed or was cancelled"
exit 1
fi
echo "All CI checks passed or were appropriately skipped"
6 changes: 0 additions & 6 deletions eng/common/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,3 @@ extends:
parameters:
DependsOn: InitStage
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunJava'])

Comment thread
msyyc marked this conversation as resolved.
# Run python stages if RunPython == true
- template: /packages/http-client-python/eng/pipeline/templates/ci-stages.yml
parameters:
DependsOn: InitStage
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunPython'])
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
// Standalone eslint config for http-client-python package
// This config is used in CI where monorepo dependencies may not be available
import eslint from "@eslint/js";
import { dirname } from "path";
import tsEslint from "typescript-eslint";
import { fileURLToPath } from "url";
Expand All @@ -12,7 +11,6 @@ export default [
{
ignores: ["**/dist/**/*", "**/node_modules/**/*"],
},
eslint.configs.recommended,
...tsEslint.configs.recommended,
{
languageOptions: {
Expand Down
Loading