Skip to content

fix(python): make the resource management README snippet valid Python - #128

Open
LukasParke wants to merge 1 commit into
speakeasy-api:mainfrom
LukasParke:fix/python-resource-management-snippet
Open

LukasParke wants to merge 1 commit into
speakeasy-api:mainfrom
LukasParke:fix/python-resource-management-snippet

Conversation

@LukasParke

@LukasParke LukasParke commented Oct 21, 2026 •

Copy link
Copy Markdown

Why

The Python README "Resource Management" section shows how to create the SDK via a context manager, but the with ...: and async with ...: blocks contain only a # Rest of application here... comment. A block whose body is only a comment is not valid Python, so copying the snippet raises:

IndentationError: expected an indented block after 'with' statement

What changed

  • templates/templates/pythonv2/readme/resource-management.stmpl: emit pass after the placeholder comment in the sync and async blocks, for both asyncMode: both and asyncMode: split.
  • zSDKs/sdk-pythonv2/README.md: regenerated review SDK; the only change is the two added pass lines in the Resource Management section.
  • .changesets/: patch changeset for docs / pythonv2.

No other target uses this template.

Testing

  • npm run format: no changes.
  • make check-template-pythonv2: passed.
  • TARGET=review make build-pythonv2: the only diff in zSDKs/ is the two pass lines in the README.
  • TARGET=primary make test-pythonv2: passed.
  • Pulled the Resource Management code block out of the regenerated review README (asyncMode: split) and the primary README (asyncMode: both) and ran ast.parse on each. Both parse now; the review block from before the change fails with the IndentationError above.
  • git diff --check: clean.

Public-safety check

  • This change contains no credentials, customer documents, private repository URLs, private filesystem paths, or unredacted private logs.
  • Title, body, comments, and commit messages name no customers or customer-derived identifiers, private paths or trackers, or workflow provenance, and are understandable without private context (.claude/skills/public-repo-communication/SKILL.md).
  • Generated fixtures and review SDK changes are public-safe.
  • I reviewed git diff --check.

Summary by cubic

Fixes the Python Resource Management README snippet so copied code no longer raises an IndentationError.

The template's with and async with blocks contained only a comment, which is invalid Python. Adds a pass statement after the placeholder comment, regenerates the review SDK README, and adds a patch changeset for docs/pythonv2. No other templates use this file.

Written for commit bc31e63. Summary will update on new commits.

View guided diff

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the python Trigger (106) snapshot tests for python label Oct 21, 2026
The Resource Management README section rendered `with` and `async with`
blocks whose bodies contained only a comment, so copying the snippet
raised an IndentationError. Add a `pass` statement after the placeholder
comment in both async modes.
@LukasParke
LukasParke force-pushed the fix/python-resource-management-snippet branch from 9500d65 to bc31e63 Compare October 21, 2026 19:13
@LukasParke

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@LukasParke

Copy link
Copy Markdown
Author

recheck

github-actions Bot added a commit that referenced this pull request Oct 21, 2026
@LukasParke
LukasParke marked this pull request as ready for review October 21, 2026 19:19
@LukasParke
LukasParke requested a review from a team as a code owner October 21, 2026 19:19
@LukasParke
LukasParke requested a review from 2ynn October 21, 2026 19:19
@2ynn

2ynn commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Thank you @LukasParke for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Trigger (106) snapshot tests for python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants