Skip to content

[typespec-python] simplify eng#4399

Open
msyyc wants to merge 45 commits into
mainfrom
python-update-eng
Open

[typespec-python] simplify eng#4399
msyyc wants to merge 45 commits into
mainfrom
python-update-eng

Conversation

@msyyc
Copy link
Copy Markdown
Member

@msyyc msyyc commented May 8, 2026

Summary

Reduce duplication between typespec-python (a thin wrapper) and upstream @typespec/http-client-python so we don't keep maintaining two copies of the same eng/test scaffolding by hand.

Approach

  • eng/scripts/sync.ts — new allow-list mirror that copies a curated set of shared files from a sibling checkout (<repo-root>/core/packages/http-client-python/) into this package. Supports --check for CI drift detection.
  • eng/scripts/ci/regenerate-common.ts — shared helpers / spec tables / prepareBaselineOfGeneratedCode, byte-identical with the upstream copy. Synced.
  • eng/scripts/ci/regenerate.ts — kept per-repo: wrapper does single-phase in-process regen; upstream does two-phase. Imports common helpers, owns only paths/argv/orchestration.
  • dev_requirements.txt — synced as a section (everything before the # additional dependency needed for development marker is replaced from upstream; wrapper-only deps like setuptools are preserved).
  • Synced shared CI runners: run_apiview.py, run_mypy.py, run_pylint.py, run_pyright.py, run_sphinx_build.py, util.py, plus mypy.ini, pylintrc, pyrightconfig.json.
  • Synced shared test assets / drivers: tests/data/, tests/mock_api/, tests/requirements/, tests/conftest.py, tests/install_packages.py, tests/tox.ini, and the generator/ (pygen) tree.
  • eng/scripts/setup/* is intentionally not synced — the wrapper owns its own setup pipeline (install.py, prepare.py, venvtools.py, …).

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:python Issues for @azure-tools/typespec-python emitter label May 8, 2026
@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented May 8, 2026

All changed packages have been documented.

  • @azure-tools/typespec-python
Show changes

@azure-tools/typespec-python - internal ✏️

Simplify eng system for typespec-python

@github-actions

This comment was marked as off-topic.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-python@4399

commit: 27baff9

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented May 8, 2026

You can try these changes here

🛝 Playground 🌐 Website

@Azure Azure deleted a comment from github-actions Bot May 8, 2026
@msyyc msyyc force-pushed the python-update-eng branch from 4086527 to bde5c8d Compare May 9, 2026 03:35
@Azure Azure deleted a comment from github-actions Bot May 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

⚡ Benchmark Results

⚠️ 1 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 12.2ms 🟡 13.5ms +10.2% 🔴
Full details – comparing 7352c9e vs baseline 56d1590
Metric Baseline Current Change
total 🔴 6.49s 🔴 6.11s -5.8% 🟢
loader 🟢 156.5ms 🟢 143.3ms -8.4% 🟢
resolver 🟢 21.6ms 🟢 15.0ms -30.7% 🟢
checker 🟢 189.0ms 🟢 180.3ms -4.6%
validation 🟢 43.2ms 🟢 40.1ms -7.2% 🟢
 ↳ validation/@azure-tools/typespec-azure-core 🟢 6.4ms 🟢 6.0ms -6.6%
 ↳ validation/@typespec/http 🟢 5.4ms 🟢 5.2ms -3.7%
 ↳ validation/@typespec/rest 🟢 0.6ms 🟢 0.5ms -15.5%
 ↳ validation/@typespec/versioning 🔴 28.7ms 🔴 27.0ms -5.9% 🟢
 ↳ validation/compiler 🟢 1.6ms 🟢 1.3ms -21.4%
linter 🟢 130.5ms 🟢 127.3ms -2.5%
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.0ms -3.5%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.2ms 🟢 0.2ms +6.6%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 5.6ms 🟢 5.8ms +3.2%
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.6ms 🟢 0.6ms -0.8%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms -6.1%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 0.9ms 🟢 0.7ms -15.1%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.6ms 🟢 0.7ms +9.3%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.1ms -8.5%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.3ms 🟢 0.3ms -1.1%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.3ms 🟢 0.3ms -8.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.2ms 🟢 0.2ms -11.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.3ms 🟢 0.2ms -10.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.0ms 🟢 0.0ms -13.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.1ms 🟢 0.1ms +2.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms -3.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.6ms 🟢 0.6ms +14.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.4ms 🟢 0.3ms -22.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🟡 19.2ms 🟡 18.5ms -3.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.1ms 🟢 1.2ms +6.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.1ms -4.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.2ms 🟢 0.2ms -6.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.1ms 🟢 1.1ms -3.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 2.1ms 🟢 1.9ms -9.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 1.9ms 🟢 1.8ms -6.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🟡 19.0ms 🟡 18.4ms -3.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 22.6ms 🔴 22.5ms -0.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.0ms 🟢 0.0ms -22.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 4.5ms 🟢 5.0ms +11.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.2ms 🟢 0.2ms -12.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.0ms 🟢 0.0ms -11.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.2ms 🟢 0.2ms +12.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.4ms 🟢 0.4ms -1.1%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.2ms 🟢 0.2ms -6.9%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.3ms 🟢 0.3ms -12.3%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms -34.8%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 21.3ms 🔴 20.7ms -2.5%
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.3ms 🟢 0.3ms -0.5%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.3ms -5.1%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 5.0ms 🟢 4.9ms -1.6%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.1ms 🟢 0.1ms -4.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 3.8ms 🟢 3.8ms -1.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.1ms -2.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms -2.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 4.7ms 🟢 4.8ms +1.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟢 4.2ms 🟢 4.1ms -4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.4ms 🟢 0.4ms +1.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.4ms 🟢 0.4ms -5.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.0ms 🟢 0.0ms -12.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.2ms 🟢 0.2ms +8.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.1ms 🟢 0.1ms +3.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.0ms 🟢 0.0ms -23.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms -6.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.1ms 🟢 0.1ms -4.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.0ms 🟢 0.0ms -8.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.2ms 🟢 0.2ms -2.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.0ms 🟢 0.0ms -38.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.2ms 🟢 0.2ms +1.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 4.4ms 🟢 4.3ms -0.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.3ms 🟢 0.3ms -4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.2ms 🟢 0.2ms +0.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.1ms 🟢 0.1ms +2.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.1ms -5.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.1ms 🟢 0.1ms +0.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.0ms -14.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 12.2ms 🟡 13.5ms +10.2% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.0ms 🟢 0.0ms -6.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.3ms 🟢 0.3ms -3.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.1ms 🟢 0.1ms -10.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.2ms 🟢 0.2ms -4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🟡 19.5ms 🔴 20.3ms +4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.1ms 🟢 0.1ms -2.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.1ms 🟢 0.1ms -4.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 2.7ms 🟢 2.0ms -26.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.4ms 🟢 0.4ms +1.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.0ms 🟢 0.0ms -12.5%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.0ms 🟢 1.1ms +1.9%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.2ms 🟢 0.2ms -27.8%
emit 🔴 5.89s 🔴 5.53s -6.2% 🟢
 ↳ emit/@azure-tools/typespec-autorest 🟢 199.7ms 🟢 154.8ms -22.5% 🟢
 ↳ emit/@azure-tools/typespec-python 🔴 4.24s 🔴 3.99s -6.0% 🟢
 ↳ emit/@typespec/http-client-js 🔴 1.17s 🔴 1.16s -1.1%
 ↳ emit/@typespec/openapi3 🟢 150.5ms 🟢 138.9ms -7.7% 🟢
 ↳ emit/@typespec/openapi3/compute 🟢 131.4ms 🟢 121.9ms -7.3% 🟢
 ↳ emit/@typespec/openapi3/write 🟢 19.5ms 🟢 17.4ms -10.9% 🟢

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

msyyc and others added 7 commits May 9, 2026 13:40
…eing wrapper-owned

Following the recent commits that:
- removed 	ests/tox.ini and generator/ from sync.ts INCLUDES (now
  wrapper-owned, committed)
- removed generator/ from .gitignore (now tracked)
- committed tests/requirements/* and tests/conftest.py as synced snapshots

…the prose comments around the INCLUDES list and the gitignore header
no longer matched what's actually being synced. Refresh them so a new
reader can tell at a glance:
  * which files are upstream-truth (kept aligned via pnpm sync)
  * which files are wrapper-owned (and *why* — including the upstream
    install_packages.py bug tracked in microsoft/typespec#10636)
  * which synced paths are gitignored vs committed snapshots

No behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This upstream test is unbranded-only and doesn't apply to the Azure
wrapper. Add an EXCLUDED_FILES allow-list to sync.ts that:
  - skips the file during the copy phase, and
  - prunes it from the destination if a previous sync (or a manual
    edit) left it behind.

In --check mode the file is reported as drift so CI catches accidental
re-introduction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Backmerge of hotfix release tcgc@0.69.0 from `release/may-2026` into
`main`.

This ensures the version bump and fixes are reflected in main.

⚠️ **Rebase merge** this PR (do not squash).

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Co-authored-by: tadelesh <chenjieshi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label May 26, 2026
@msyyc msyyc enabled auto-merge June 2, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:python Issues for @azure-tools/typespec-python emitter eng lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants