Skip to content

Preserve customized Python test fixtures - #11422

Merged
msyyc merged 16 commits into
mainfrom
python-test-update
Jul 29, 2026
Merged

Preserve customized Python test fixtures#11422
msyyc merged 16 commits into
mainfrom
python-test-update

Conversation

@msyyc

@msyyc msyyc commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • track generated Python fixtures that contain test-required customizations
  • preserve those fixtures while cleaning other generated packages
  • document why each fixture must survive regeneration

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jul 28, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11422

commit: 1a46216

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - internal ✏️

Track only hand-authored test fixture files instead of whole generated packages, and clean generated test code with git clean during regeneration.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:d320a53bb33cf1cbf7f5e2742b9da369944ae9be vs this PR.

Diff summary: 45 file(s), +45 / -275

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

@azure-sdk-automation

azure-sdk-automation Bot commented Jul 28, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@msyyc
msyyc enabled auto-merge July 28, 2026 09:06

@tadelesh tadelesh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer only keep _patch.py in the source code. Could you please check if Python could adopt Go's git ignore solution: https://github.com/Azure/typespec-azure/blob/d7e19546374047f90ee322da471b2e90a49f6dee/.gitignore#L230

msyyc and others added 3 commits July 29, 2026 15:24
Instead of committing whole generated packages and hard-coding an allowlist of
preserved folders in the regeneration script, ignore everything under
tests/generated and re-include only the hand-authored files, each with a comment
explaining why it cannot be regenerated.

Regeneration now cleans with `git clean -xdf -- tests/generated`, which deletes
ignored/untracked files but never tracked ones, so .gitignore is the single
source of truth.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: abb15bc1-4c77-451e-9ff0-46971b14d9b0
@msyyc

msyyc commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

I prefer only keep _patch.py in the source code. Could you please check if Python could adopt Go's git ignore solution: https://github.com/Azure/typespec-azure/blob/d7e19546374047f90ee322da471b2e90a49f6dee/.gitignore#L230

Reduced unnecessary generated files and only 30 files are left now.

@msyyc
msyyc requested a review from tadelesh July 29, 2026 08:09
Comment thread packages/http-client-python/.gitignore
Comment thread packages/http-client-python/.gitignore
@msyyc
msyyc added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 20a02b2 Jul 29, 2026
42 checks passed
@msyyc
msyyc deleted the python-test-update branch July 29, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants