fix: unbreak SDK generation (pyright, not mypy/pylint, gates Compile SDK) - #16
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python SDK generation has failed on every prod deploy since 07-26 (6 consecutive runs). PyPI
textql-sdkis stuck at 1.0.5 from 07-22, while@textql/sdkis 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/10locally and stamped# pylint: skip-file/# mypy: ignore-errorsonto the vendored tree — neither of which pyright honours. So 33 errors in_connect/stayed unsuppressed:ClassVar is not allowed in this contextin the extension stubs, and_ExtensionDictmissing fromtypes-protobuf.Fixed by adding a pyright header in
postprocess-connect.pyalongside the other two. Deliberately scoped to the rules the pyi plugin trips — notreportMissingImports, which is exactly what fires whenspeakeasy runregeneratespyproject.tomlwithoutconnect-python. That failure must keep failing loudly.The other 4 were a regression from #15
It renamed
on_end's parameters to_token/_ctx/_errorto satisfy pylint's unused-argument check, on the reasoning that "connectrpc calls them positionally." True at runtime —MetadataInterceptorInvokerdoes call positionally. ButMetadataInterceptordoesn't mark them positional-only, so pyright matches structurally by name, and_ApiKeyInterceptorsilently stopped satisfying the protocol.Restored the names; pylint silenced with a targeted
disable=unused-argumentinstead.Verification
Run locally, the step that was skipped last time:
uv run pyright src/uv run mypy src/uv run pylint src/textql_sdkcreate_connect_client_sync(ChatServiceClientSync, sdk)constructsThe 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:
Worth noting
Six deploys failed in silence. Generation dies before opening a PR, so
sdk_publish.yamlnever runs and nothing notifies — every deploy thread stayed green. Reproduce CI locally withuv run pyright src/before pushing.🤖 Generated with Claude Code