chore(python): upgrade to connectrpc 0.10.0 and pin all buf plugins#93
Merged
Merged
Conversation
shimmeg
approved these changes
May 6, 2026
Closes #87. Bumps the Python ConnectRPC runtime from `connect-python==0.9.0` to `connectrpc==0.10.0` (released 2026-04-28). Upstream renamed both PyPI distributions at this version: `connect-python` -> `connectrpc`, and `protoc-gen-connect-python` -> `protoc-gen-connectrpc`. The Python module path `connectrpc.X` is unchanged - only the distribution names moved. Why this is required: the buf remote plugin `buf.build/connectrpc/python` in `buf.gen.yaml` is unpinned, so every `buf generate` picks the latest plugin. The 0.10 plugin emits `from connectrpc.codec import Codec` and a `codecs=` kwarg on ASGI/WSGI Application constructors, which the 0.9 runtime locked in `python/uv.lock` doesn't accept. Today master ships matched 0.9-shape generated code, but the next regen on master would silently break Python at import time. This PR also pins all 8 unpinned `buf.gen.yaml` plugins to versions that match the runtime each language SDK already uses, so regen is no-op for Go/Node/C# and only the 7 Python `*_connect.py` files are intentionally updated to the v0.10 shape. Future upgrades stay easy: bump the runtime in pyproject.toml/go.mod/package.json AND the matching plugin pin in `buf.gen.yaml` together in one PR. No SDK source code changes are needed: - `network/client.py` constructs clients with `(base_url, http_client=..., timeout_ms=...)`, which still binds against the v0.10 client `__init__`. - `provider/handler.py` passes only `interceptors=` to the generated Application classes; v0.10's new `codecs=None` default is filled by `get_default_codecs()`. - `connectrpc.code.Code`, `connectrpc.errors.ConnectError`, `connectrpc.request.RequestContext`/`Headers` are byte-identical between v0.9.0 and v0.10.0 (verified against upstream tags). Behavioural note: upstream PR #219 in v0.10 makes non-`ConnectError` handler exceptions re-raise after sending the wire response (logged via `wsgi.errors` in WSGI). All SDK interceptors raise `ConnectError`, so client-facing behaviour is unchanged - only stderr visibility improves when an unrelated bug raises a plain `Exception`. Verified locally: 96/96 Python SDK tests pass, ruff clean, Go tests green, Node 23/23, C# 54/54. The `python/tests/cross_test/go_helper` build failure is a pre-existing infrastructure issue on master (its `go.mod` pins a Go module tag the local toolchain can't resolve), unrelated to this change. Doc updates drop the now-stale "DO NOT use connectrpc from PyPI" warning across 6 files. The PyPI name is now the official one as of v0.10.0; the squatted v0.0.1 by Gaudiy predates 0.9.0 and is skipped by the `>=0.10.0` floor pin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2030188 to
1247436
Compare
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.
Closes #87.
Summary
connect-python==0.9.0(deprecated) toconnectrpc==0.10.0— upstream renamed the PyPI distribution at v0.10.0 (module pathconnectrpc.Xis unchanged).buf.gen.yamlplugins. Theconnectrpc/python:v0.10.0pin is the actual fix for Upgrade connect-python to 1.10.0 #87; the other 7 match the version each language SDK already uses, so regen is a no-op for Go/Node/C#.*_connect.pyfiles (includingsystem_connect.pyfrom the merged SystemService PR feat: add SystemService.Health() auto-registered across all SDKs #90) to the v0.10 plugin shape (addsfrom connectrpc.codec import Codecand acodecs=kwarg on every ASGI/WSGI Application__init__).system_connect.py" notes fromdocs/SYSTEM_SERVICE.mdandpython/CLAUDE.md, and the matching "Known gaps" entry about unpinned buf plugins.>=0.10.0skips the squatted v0.0.1).Why this is required
buf.gen.yamldid not pinbuf.build/connectrpc/python, so everybuf generatepicks the latest plugin. The 0.10 plugin emits acodecs=kwarg that the 0.9 runtime currently locked inpython/uv.lockdoesn't accept. PR #90 worked around this by manually patchingsystem_connect.pyand documenting "re-apply the patch after everybuf generate." This PR resolves the underlying drift: the runtime + plugin pair now match at 0.10.0, the manual patch is gone, and pinning all plugins keeps regen reproducible.SDK source code: no changes
network/client.pyconstructs clients with(base_url, http_client=…, timeout_ms=…)— still binds against the v0.10 client__init__.provider/handler.pypasses onlyinterceptors=to the generated Application classes; v0.10's newcodecs=Nonedefault is filled byget_default_codecs().connectrpc.code.Code,connectrpc.errors.ConnectError,connectrpc.request.RequestContext/Headersare byte-identical between v0.9.0 and v0.10.0 (verified against upstream tags).Behavioural note (no client-facing change)
Upstream PR connectrpc/connect-python#219 makes non-
ConnectErrorhandler exceptions re-raise after sending the wire response (logged viawsgi.errorsin WSGI). All SDK interceptors raiseConnectError, so what a caller sees is unchanged — only stderr visibility improves when an unrelated bug raises a plainException.Future upgrade workflow
Pinning is for reproducibility, not freezing. When a runtime SDK is bumped (Go/Node/Python/C#), bump the matching plugin pin in
buf.gen.yamlin the same PR and runbuf generate. The TODO inbuf.gen.yamlis removed; a one-line note replaces it.Test plan
uv run pytest sdk/tests— 99/99 pass (matches issue Upgrade connect-python to 1.10.0 #87's stated baseline; includes PR feat: add SystemService.Health() auto-registered across all SDKs #90's SystemService tests)uv run ruff check .— cleanfrom connectrpc.codec import Codec; from t0_provider_sdk.api.tzero.v1.system.system_connect import SystemServiceASGIApplication— okgo test ./...— green (verifies Go plugin pin produces no diff)npm run build && npm test(node/sdk) — 23/23dotnet build && dotnet test(csharp) — 54/54Out of scope
java/sdk/buf.gen.yaml(already pinned).connectrpc.com/connect1.19.1→1.19.2 ingo/go.mod(open dependabot PR).python/tests/cross_test/go_helperbuild failure is pre-existing on master (itsgo.modpins a Go module tag the local toolchain can't resolve) — unrelated to this PR.🤖 Generated with Claude Code