BREAKING CHANGE: PyPI package renamed to connectrpc
This is the last version published as the connect-python package - we have migrated to connectrpc as part of this release to match the same code you write with it and will only publish future versions to connectrpc. Make sure to update your dependency specifications to connectrpc to continue to receive updates. Sorry for the churn as we get closer to a stable state.
This release includes a significant rework to compression handling - now, it is possible to implement custom compression methods or configure defaults with custom parameters. This release also allows configuring the supported compression methods for a server rather than automatically inspecting from application dependencies. Defaults now match other Connect implementations, only enabling gzip by default.
We have also added some other small enhancements like gRPC-Web support and improved debugging.
☢️ Breaking changes
Pass compressions rather than strings when configuring the client
Before:
GreeterClient("http://localhost", accept_compressions=["zstd", "br", "gzip"])After:
from connectrpc.compression.brotli import BrotliCompression
from connectrpc.compression.gzip import GzipCompression
from connectrpc.compression.zstd import ZstdCompression
GreeterClient("http://localhost", accept_compressions=[
ZstdCompression(), BrotliCompression(), GzipCompression()
])To configure a client to use gRPC protocol, pass protocol=ProtocolType.GRPC instead of grpc=True
Before:
GreeterClient("http://localhost", grpc=True)After:
from connectrpc.protocol import ProtocolType
GreeterClient("http://localhost", protocol=ProtocolType.GRPC)Metadata interceptors now accept Error | None in on_end
Before:
class MyInterceptor:
def on_end(self, token, ctx):
...After:
class MyInterceptor:
def on_end(self, token, ctx, error):
...📈 Enhancements
- Allow setting supported compressions in server by @anuraaga in #98
- Make Compression protocol public and default to gzip-only by @anuraaga in #103
- Mark codegen plugin as supporting edition 2024 by @stefanvanburen in #125
- Add support for debug in error details by @stefanvanburen in #147
- Add exception to metadata interceptors on_end by @anuraaga in #149
- Add support for gRPC-web by @anuraaga in #161
🛠️ Bug fixes
- Process GET params for empty request messages by @Zaczero in #121
-
- Fix server streaming handler not cancelled on client disconnect by @stefanvanburen in #175
New Contributors
Full Changelog: v0.8.1...v0.9.0