Skip to content

Migrate to protobuf-py and rename repo to connect-py#274

Merged
anuraaga merged 7 commits into
connectrpc:mainfrom
anuraaga:protobuf-py
Jun 25, 2026
Merged

Migrate to protobuf-py and rename repo to connect-py#274
anuraaga merged 7 commits into
connectrpc:mainfrom
anuraaga:protobuf-py

Conversation

@anuraaga

@anuraaga anuraaga commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This brings the long awaited update to target the new protobuf-py implementation. Along with it, we will rename the repo to connect-py so this incorporates docs updates for that as well.

  • Default dependency is protobuf-py
  • A compat package with codecs targeting google.protobuf is included, and automatically used by gencode if passing the option protobuf=google
  • Rename protoc-gen-connect-python to protoc-gen-connectrpc which could have happened before too
  • Docs are generally updated to follow connect-es's pattern of using just Connect in prose, and connect-py only in repo links (before we used Connect-Python in prose)
  • I will backfill unit tests for the codegen plugin (it is mostly tested implicitly except for the io option). I owe a testing utility for this in protobuf-py

anuraaga added 2 commits June 24, 2026 15:34
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>

@stefanvanburen stefanvanburen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just some nits. 🚢

Comment thread .gitignore Outdated
Comment on lines 113 to 121
protoc-gen-connect-python/protoc-gen-connect-python

# goreleaser archives
out/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a couple of others we could delete while we're here?

if test_request.cancel:
match test_request.cancel.cancel_timing:
case Oneof("after_close_send_ms", after_close_send_ms):
await asyncio.sleep(after_close_send_ms / 1000.0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should this also await request_closed.wait() similar to the async case below? (looks like this was already the case in the code, just think it ought to match?)

Comment thread src/connectrpc/_codec.py Outdated
# https://github.com/python/typeshed/issues/9006.
message.ParseFromString(data) # ty: ignore[invalid-argument-type]
return message
return message.__class__.from_binary(data) # TODO: fix type

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guessing this needs an upstream fix?

@anuraaga anuraaga Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops nice catch! Nope it's a fix to the codec type here to allow using protobuf-py's classmethod style better that I had initially punted.

anuraaga and others added 2 commits June 24, 2026 22:30
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Stefan VanBuren <stefan@vanburen.xyz>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
anuraaga added 2 commits June 24, 2026 22:31
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
@anuraaga
anuraaga merged commit 28e38ad into connectrpc:main Jun 25, 2026
24 checks passed
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.

2 participants