Skip to content

fix: unbreak SDK generation (mypy/pylint failing since streaming PR) - #15

Merged
rodnnnney merged 1 commit into
mainfrom
fix/sdk-generation-lint
Jul 28, 2026
Merged

fix: unbreak SDK generation (mypy/pylint failing since streaming PR)#15
rodnnnney merged 1 commit into
mainfrom
fix/sdk-generation-lint

Conversation

@rodnnnney

@rodnnnney rodnnnney commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

patch sdk generation

Speakeasy's Compile SDK step has failed on every generation run since
PR #13, so no SDK has been published since 1.0.5.

Root cause: `.speakeasy/gen.yaml` had an empty `additionalDependencies`,
so each `speakeasy run` regenerated `pyproject.toml` without the
hand-added `connect-python`/`protobuf` deps. `uv sync --dev` then
uninstalled them and the vendored `_connect` tree stopped resolving —
609 mypy errors and pylint 3.57/10 (exit 22).

- gen.yaml: declare connect-python, protobuf and types-protobuf so they
  survive regeneration. pyproject.toml and pylintrc are gen-managed, so
  this is the only durable place for them.
- scripts/postprocess-connect.py (new, idempotent, run at the end of
  generate-connect.sh): relative-ise absolute imports in the .pyi stubs
  (protoletariat only matches protoc's alias convention, so it skipped
  46 of them), prune package-stub entries for deleted subtrees, and
  prepend pylint/mypy opt-outs to the generated files — protobuf codegen
  emits ~64k pylint messages and cannot be silenced from config.
- streaming.py: rename unused on_end/on_end_sync params to _-prefixed
  (pylintrc already ignores those). connectrpc calls them positionally.
- pyproject.toml: match the generator's output byte-for-byte so main is
  a fixed point. Dropping "*.pyi" from package-data is a no-op —
  setuptools includes stubs automatically (verified: 68 either way).

Verified with a real `speakeasy run` against a scratch copy: the
regenerated pyproject keeps all three deps, and _connect, the headers
and streaming.py all survive. From a clean venv: mypy clean (was 223
locally), pylint 10.00/10, runtime import and client construction OK.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtypes-protobuf@​7.34.1.20260518100100100100100

View full report

@rodnnnney
rodnnnney merged commit 355f8a5 into main Jul 28, 2026
6 checks passed
rodnnnney added a commit that referenced this pull request Jul 28, 2026
…SDK) (#16)

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>
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