Skip to content

fix: unbreak SDK generation (pyright, not mypy/pylint, gates Compile SDK) - #16

Merged
rodnnnney merged 1 commit into
mainfrom
fix/pyright-unbreak-generation
Jul 28, 2026
Merged

fix: unbreak SDK generation (pyright, not mypy/pylint, gates Compile SDK)#16
rodnnnney merged 1 commit into
mainfrom
fix/pyright-unbreak-generation

Conversation

@rodnnnney

Copy link
Copy Markdown
Collaborator

Python SDK generation has failed on every prod deploy since 07-26 (6 consecutive runs). PyPI textql-sdk is stuck at 1.0.5 from 07-22, while @textql/sdk is at 1.3.6.

#15 fixed the dependency eviction and took it from 520 errors to 37 — but generation still fails. Two reasons.

Speakeasy's "Compile SDK" step runs pyright

Not mypy, not pylint. #15 verified mypy clean, pylint 10.00/10 locally and stamped # pylint: skip-file / # mypy: ignore-errors onto the vendored tree — neither of which pyright honours. So 33 errors in _connect/ stayed unsuppressed: ClassVar is not allowed in this context in the extension stubs, and _ExtensionDict missing from types-protobuf.

Fixed by adding a pyright header in postprocess-connect.py alongside the other two. Deliberately scoped to the rules the pyi plugin trips — not reportMissingImports, which is exactly what fires when speakeasy run regenerates pyproject.toml without connect-python. That failure must keep failing loudly.

The other 4 were a regression from #15

It renamed on_end's parameters to _token/_ctx/_error to satisfy pylint's unused-argument check, on the reasoning that "connectrpc calls them positionally." True at runtime — MetadataInterceptorInvoker does call positionally. But MetadataInterceptor doesn't mark them positional-only, so pyright matches structurally by name, and _ApiKeyInterceptor silently stopped satisfying the protocol.

Restored the names; pylint silenced with a targeted disable=unused-argument instead.

Verification

Run locally, the step that was skipped last time:

check result
uv run pyright src/ 0 errors (was 37)
uv run mypy src/ clean, 1798 files
uv run pylint src/textql_sdk 10.00/10
runtime create_connect_client_sync(ChatServiceClientSync, sdk) constructs

The 184 touched files under _connect/ are just the new header line.

After merge

Generation needs a forced run to catch up the six days of drift — it won't self-heal until the next deploy:

gh workflow run "Generate" --repo TextQLLabs/textql-python-v3 -f force=true

Worth noting

Six deploys failed in silence. Generation dies before opening a PR, so sdk_publish.yaml never runs and nothing notifies — every deploy thread stayed green. Reproduce CI locally with uv run pyright src/ before pushing.

🤖 Generated with Claude Code

…SDK)

Generation has failed on every deploy since 07-26 and the SDK is stuck at
1.0.5 (07-22). #15 fixed the dependency eviction -- 520 errors down to 37 --
but generation still fails, because the checker Speakeasy's "Compile SDK"
step actually runs is pyright, and #15 verified mypy and pylint.

Neither `# pylint: skip-file` nor `# mypy: ignore-errors` affects pyright, so
the vendored _connect stubs stayed unsuppressed (33 errors: ClassVar in
extension stubs, _ExtensionDict missing from types-protobuf).

The other 4 were a regression from #15. It renamed on_end's parameters to
_token/_ctx/_error for pylint, reasoning that connectrpc calls them
positionally -- true at runtime, but MetadataInterceptor does not mark them
positional-only, so pyright matches structurally by name and _ApiKeyInterceptor
stopped satisfying the protocol.

- postprocess-connect.py: add a pyright header alongside the pylint/mypy ones.
  Only the rules the pyi plugin trips are disabled -- deliberately NOT
  reportMissingImports, which is what fires when pyproject.toml regenerates
  without connect-python. That failure must stay loud.
- streaming.py: restore the protocol's parameter names, silence pylint with a
  targeted disable instead.

Verified locally: pyright 0 errors (was 37), mypy clean across 1798 files,
pylint 10.00/10, and a real client constructs through the interceptor path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rodnnnney
rodnnnney merged commit c4bc5e1 into main Jul 28, 2026
6 checks passed
@rodnnnney
rodnnnney deleted the fix/pyright-unbreak-generation branch July 28, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant