From 4f018ab647dfc9e9b50f03164e4b9cb790db5f7e Mon Sep 17 00:00:00 2001 From: tsubakiky Date: Sun, 3 Aug 2025 12:10:12 +0900 Subject: [PATCH 1/3] rename connectrpc --- README.md | 14 ++-- .../generator/generator.go | 6 +- .../generator/package.go | 6 +- conformance/client_runner.py | 12 +-- .../conformancev1connect/service_connect.py | 12 +-- conformance/pyproject.toml | 9 +- conformance/server.py | 12 +-- conformance/uv.lock | 82 +++++++++---------- examples/client.py | 4 +- examples/cmd/examples-go/client/main.go | 2 +- .../eliza/v1/v1connect/eliza_connect.py | 6 +- .../eliza/v1/v1connect/eliza_connect_pb2.py | 6 +- examples/pyproject.toml | 4 +- examples/server.py | 6 +- examples/uv.lock | 12 +-- pyproject.toml | 6 +- src/{gconnect => connectrpc}/__init__.py | 40 ++++----- .../asgi_helpers/__init__.py | 0 .../asgi_helpers/utils.py | 2 +- src/{gconnect => connectrpc}/call_options.py | 0 src/{gconnect => connectrpc}/client.py | 28 +++---- .../client_interceptor.py | 4 +- src/{gconnect => connectrpc}/code.py | 0 src/{gconnect => connectrpc}/codec.py | 0 src/{gconnect => connectrpc}/compression.py | 0 src/{gconnect => connectrpc}/connect.py | 12 +-- .../connection_pool.py | 0 .../content_stream.py | 2 +- src/{gconnect => connectrpc}/envelope.py | 10 +-- src/{gconnect => connectrpc}/error.py | 4 +- src/{gconnect => connectrpc}/handler.py | 32 ++++---- .../handler_context.py | 0 .../handler_interceptor.py | 4 +- src/{gconnect => connectrpc}/headers.py | 0 .../idempotency_level.py | 0 src/{gconnect => connectrpc}/middleware.py | 4 +- src/{gconnect => connectrpc}/options.py | 6 +- src/{gconnect => connectrpc}/protocol.py | 20 ++--- .../protocol_connect/__init__.py | 0 .../protocol_connect/base64_utils.py | 0 .../protocol_connect/connect_client.py | 32 ++++---- .../protocol_connect/connect_handler.py | 37 +++++---- .../protocol_connect/connect_protocol.py | 12 +-- .../protocol_connect/constants.py | 4 +- .../protocol_connect/content_type.py | 12 +-- .../protocol_connect/end_stream.py | 8 +- .../protocol_connect/error_code.py | 2 +- .../protocol_connect/error_json.py | 6 +- .../protocol_connect/marshaler.py | 18 ++-- .../protocol_connect/unmarshaler.py | 16 ++-- .../protocol_grpc/__init__.py | 0 .../protocol_grpc/constants.py | 4 +- .../protocol_grpc/content_type.py | 8 +- .../protocol_grpc/error_trailer.py | 10 +-- .../protocol_grpc/grpc_client.py | 30 +++---- .../protocol_grpc/grpc_handler.py | 30 +++---- .../protocol_grpc/grpc_protocol.py | 12 +-- .../protocol_grpc/marshaler.py | 8 +- .../protocol_grpc/unmarshaler.py | 10 +-- src/{gconnect => connectrpc}/request.py | 0 src/{gconnect => connectrpc}/response.py | 0 .../response_writer.py | 2 +- src/{gconnect => connectrpc}/utils.py | 4 +- src/{gconnect => connectrpc}/version.py | 0 tests/conftest.py | 6 +- tests/test_streaming_connect_client.py | 18 ++-- tests/test_streaming_connect_server.py | 16 ++-- tests/test_unary_connect_client.py | 18 ++-- tests/test_unary_connect_server.py | 8 +- .../ping/v1/v1connect/ping_connect.py | 8 +- uv.lock | 8 +- 71 files changed, 361 insertions(+), 353 deletions(-) rename src/{gconnect => connectrpc}/__init__.py (60%) rename src/{gconnect => connectrpc}/asgi_helpers/__init__.py (100%) rename src/{gconnect => connectrpc}/asgi_helpers/utils.py (97%) rename src/{gconnect => connectrpc}/call_options.py (100%) rename src/{gconnect => connectrpc}/client.py (95%) rename src/{gconnect => connectrpc}/client_interceptor.py (97%) rename src/{gconnect => connectrpc}/code.py (100%) rename src/{gconnect => connectrpc}/codec.py (100%) rename src/{gconnect => connectrpc}/compression.py (100%) rename src/{gconnect => connectrpc}/connect.py (99%) rename src/{gconnect => connectrpc}/connection_pool.py (100%) rename src/{gconnect => connectrpc}/content_stream.py (99%) rename src/{gconnect => connectrpc}/envelope.py (98%) rename src/{gconnect => connectrpc}/error.py (99%) rename src/{gconnect => connectrpc}/handler.py (97%) rename src/{gconnect => connectrpc}/handler_context.py (100%) rename src/{gconnect => connectrpc}/handler_interceptor.py (97%) rename src/{gconnect => connectrpc}/headers.py (100%) rename src/{gconnect => connectrpc}/idempotency_level.py (100%) rename src/{gconnect => connectrpc}/middleware.py (96%) rename src/{gconnect => connectrpc}/options.py (97%) rename src/{gconnect => connectrpc}/protocol.py (97%) rename src/{gconnect => connectrpc}/protocol_connect/__init__.py (100%) rename src/{gconnect => connectrpc}/protocol_connect/base64_utils.py (100%) rename src/{gconnect => connectrpc}/protocol_connect/connect_client.py (97%) rename src/{gconnect => connectrpc}/protocol_connect/connect_handler.py (96%) rename src/{gconnect => connectrpc}/protocol_connect/connect_protocol.py (91%) rename src/{gconnect => connectrpc}/protocol_connect/constants.py (93%) rename src/{gconnect => connectrpc}/protocol_connect/content_type.py (95%) rename src/{gconnect => connectrpc}/protocol_connect/end_stream.py (94%) rename src/{gconnect => connectrpc}/protocol_connect/error_code.py (98%) rename src/{gconnect => connectrpc}/protocol_connect/error_json.py (96%) rename src/{gconnect => connectrpc}/protocol_connect/marshaler.py (97%) rename src/{gconnect => connectrpc}/protocol_connect/unmarshaler.py (96%) rename src/{gconnect => connectrpc}/protocol_grpc/__init__.py (100%) rename src/{gconnect => connectrpc}/protocol_grpc/constants.py (93%) rename src/{gconnect => connectrpc}/protocol_grpc/content_type.py (96%) rename src/{gconnect => connectrpc}/protocol_grpc/error_trailer.py (96%) rename src/{gconnect => connectrpc}/protocol_grpc/grpc_client.py (95%) rename src/{gconnect => connectrpc}/protocol_grpc/grpc_handler.py (95%) rename src/{gconnect => connectrpc}/protocol_grpc/grpc_protocol.py (94%) rename src/{gconnect => connectrpc}/protocol_grpc/marshaler.py (94%) rename src/{gconnect => connectrpc}/protocol_grpc/unmarshaler.py (95%) rename src/{gconnect => connectrpc}/request.py (100%) rename src/{gconnect => connectrpc}/response.py (100%) rename src/{gconnect => connectrpc}/response_writer.py (98%) rename src/{gconnect => connectrpc}/utils.py (98%) rename src/{gconnect => connectrpc}/version.py (100%) diff --git a/README.md b/README.md index 6b2df69..006f896 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Connect is a simple, reliable, and interoperable RPC framework that combines the ## Installation ```bash -pip install gconnect +pip install connectrpc ``` **⚠️ Dependency Notice**: For gRPC/gRPC-Web support, this package uses forked libraries: @@ -70,9 +70,9 @@ protoc --plugin=$(go env GOPATH)/bin/protoc-gen-connect-python -I . --connect-py ### 3. Implement your service ```python -from gconnect.connect import UnaryRequest, UnaryResponse -from gconnect.handler_context import HandlerContext -from gconnect.middleware import ConnectMiddleware +from connectrpc.connect import UnaryRequest, UnaryResponse +from connectrpc.handler_context import HandlerContext +from connectrpc.middleware import ConnectMiddleware from starlette.applications import Starlette from starlette.middleware import Middleware @@ -118,8 +118,8 @@ if __name__ == "__main__": ### 5. Use the client ```python -from gconnect.client import UnaryRequest -from gconnect.connection_pool import AsyncConnectionPool +from connectrpc.client import UnaryRequest +from connectrpc.connection_pool import AsyncConnectionPool from ping_pb2 import PingRequest from ping_connect_pb2 import PingServiceClient @@ -266,7 +266,7 @@ This project includes a Protocol Buffer plugin (`protoc-gen-connect-python`) wri ## Contributing -We warmly welcome and greatly value contributions to the gconnect. However, before diving in, we kindly request that you take a moment to review our Contribution Guidelines. +We warmly welcome and greatly value contributions to the connectrpc. However, before diving in, we kindly request that you take a moment to review our Contribution Guidelines. Additionally, please carefully read the Contributor License Agreement (CLA) before submitting your contribution to Gaudiy. By submitting your contribution, you are considered to have accepted and agreed to be bound by the terms and conditions outlined in the CLA, regardless of circumstances. diff --git a/cmd/protoc-gen-connect-python/generator/generator.go b/cmd/protoc-gen-connect-python/generator/generator.go index 1cb92b2..b436318 100644 --- a/cmd/protoc-gen-connect-python/generator/generator.go +++ b/cmd/protoc-gen-connect-python/generator/generator.go @@ -177,7 +177,7 @@ func (g *Generator) generate(gen *protogen.GeneratedFile, f *protogen.File) { p.P(`import abc`) p.P(`from enum import Enum`) p.P() - p.P(`from gconnect import (`) + p.P(`from connectrpc import (`) p.P(` Client,`) p.P(` ClientOptions,`) p.P(` HandlerOptions,`) @@ -189,8 +189,8 @@ func (g *Generator) generate(gen *protogen.GeneratedFile, f *protogen.File) { p.P(` UnaryRequest,`) p.P(` UnaryResponse,`) p.P(`)`) - p.P(`from gconnect.connection_pool import AsyncConnectionPool`) - p.P(`from gconnect.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler`) + p.P(`from connectrpc.connection_pool import AsyncConnectionPool`) + p.P(`from connectrpc.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler`) p.P(`from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor`) p.P() diff --git a/cmd/protoc-gen-connect-python/generator/package.go b/cmd/protoc-gen-connect-python/generator/package.go index 2af8e37..338fe41 100644 --- a/cmd/protoc-gen-connect-python/generator/package.go +++ b/cmd/protoc-gen-connect-python/generator/package.go @@ -7,9 +7,9 @@ import ( // p.P(`import abc`) // p.P(`from enum import Enum`) // p.P() -// p.P(`from gconnect.connect import UnaryRequest, UnaryResponse`) -// p.P(`from gconnect.handler import UnaryHandler`) -// p.P(`from gconnect.options import HandlerOptions`) +// p.P(`from connectrpc.connect import UnaryRequest, UnaryResponse`) +// p.P(`from connectrpc.handler import UnaryHandler`) +// p.P(`from connectrpc.options import HandlerOptions`) // p.P(`from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor`) // PythonIdent is a Python identifier, consisting of a name and import path. diff --git a/conformance/client_runner.py b/conformance/client_runner.py index 265e25c..a06681d 100755 --- a/conformance/client_runner.py +++ b/conformance/client_runner.py @@ -26,12 +26,12 @@ from collections.abc import AsyncGenerator from typing import Any -from gconnect.call_options import CallOptions -from gconnect.connect import StreamRequest, UnaryRequest -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.options import ClientOptions +from connectrpc.call_options import CallOptions +from connectrpc.connect import StreamRequest, UnaryRequest +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.options import ClientOptions from google.protobuf import any_pb2 from google.protobuf.internal.containers import RepeatedCompositeFieldContainer diff --git a/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py b/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py index 09a2bf6..22c14dc 100644 --- a/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py +++ b/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py @@ -1,4 +1,4 @@ -# Generated by the protoc-gen-connect-python. DO NOT EDIT! +s# Generated by the protoc-gen-connect-python. DO NOT EDIT! # source: connectrpc/conformance/v1/conformancev1connect/service.proto # Protobuf Python Version: (unknown) # protoc-gen-connect-python version: v0.0.0-20250710124620-c0c8871def6b+dirty @@ -7,7 +7,7 @@ import abc from enum import Enum -from gconnect import ( +from connectrpc import ( Client, ClientOptions, HandlerOptions, @@ -17,10 +17,10 @@ StreamRequest, StreamResponse, ) -from gconnect import UnaryRequest as ConnectUnaryRequest -from gconnect import UnaryResponse as ConnectUnaryResponse -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler +from connectrpc import UnaryRequest as ConnectUnaryRequest +from connectrpc import UnaryResponse as ConnectUnaryResponse +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor from .. import service_pb2 diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index 0dd3d55..fc77898 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -5,10 +5,15 @@ description = "Add your description here" readme = "README.md" authors = [{ name = "tsubakiky", email = "salovers1205@gmail.com" }] requires-python = ">=3.13" -dependencies = ["anyio>=4.8.0", "gconnect", "cryptography>=44.0.2", "hypercorn"] +dependencies = [ + "anyio>=4.8.0", + "connectrpc", + "cryptography>=44.0.2", + "hypercorn", +] [tool.uv.sources] -gconnect = { path = "../" } +connectrpc = { path = "../" } hypercorn = { git = "https://github.com/tsubakiky/hypercorn" } [dependency-groups] diff --git a/conformance/server.py b/conformance/server.py index 4584d00..0cf2cd2 100644 --- a/conformance/server.py +++ b/conformance/server.py @@ -21,12 +21,12 @@ import typing import google.protobuf.any_pb2 as any_pb2 -from gconnect.code import Code -from gconnect.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse -from gconnect.error import ConnectError, ErrorDetail -from gconnect.handler_context import HandlerContext -from gconnect.headers import Headers -from gconnect.middleware import ConnectMiddleware +from connectrpc.code import Code +from connectrpc.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse +from connectrpc.error import ConnectError, ErrorDetail +from connectrpc.handler_context import HandlerContext +from connectrpc.headers import Headers +from connectrpc.middleware import ConnectMiddleware from starlette.applications import Starlette from starlette.middleware import Middleware diff --git a/conformance/uv.lock b/conformance/uv.lock index 2a8058b..15e8a1b 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -26,11 +26,11 @@ wheels = [ [[package]] name = "certifi" -version = "2025.7.14" +version = "2025.8.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b3/76/52c535bcebe74590f296d6c77c86dabf761c41980e1347a2422e4aa2ae41/certifi-2025.7.14.tar.gz", hash = "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995", size = 163981, upload-time = "2025-07-14T03:29:28.449Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/52/34c6cf5bb9285074dc3531c437b3919e825d976fde097a7a73f79e726d03/certifi-2025.7.14-py3-none-any.whl", hash = "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2", size = 162722, upload-time = "2025-07-14T03:29:26.863Z" }, + { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" }, ] [[package]] @@ -61,8 +61,8 @@ version = "0.1.0" source = { virtual = "." } dependencies = [ { name = "anyio" }, + { name = "connectrpc" }, { name = "cryptography" }, - { name = "gconnect" }, { name = "hypercorn" }, ] @@ -76,8 +76,8 @@ dev = [ [package.metadata] requires-dist = [ { name = "anyio", specifier = ">=4.8.0" }, + { name = "connectrpc", directory = "../" }, { name = "cryptography", specifier = ">=44.0.2" }, - { name = "gconnect", directory = "../" }, { name = "hypercorn", git = "https://github.com/tsubakiky/hypercorn" }, ] @@ -89,42 +89,7 @@ dev = [ ] [[package]] -name = "cryptography" -version = "45.0.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/95/1e/49527ac611af559665f71cbb8f92b332b5ec9c6fbc4e88b0f8e92f5e85df/cryptography-45.0.5.tar.gz", hash = "sha256:72e76caa004ab63accdf26023fccd1d087f6d90ec6048ff33ad0445abf7f605a", size = 744903, upload-time = "2025-07-02T13:06:25.941Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f0/fb/09e28bc0c46d2c547085e60897fea96310574c70fb21cd58a730a45f3403/cryptography-45.0.5-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:101ee65078f6dd3e5a028d4f19c07ffa4dd22cce6a20eaa160f8b5219911e7d8", size = 7043092, upload-time = "2025-07-02T13:05:01.514Z" }, - { url = "https://files.pythonhosted.org/packages/b1/05/2194432935e29b91fb649f6149c1a4f9e6d3d9fc880919f4ad1bcc22641e/cryptography-45.0.5-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3a264aae5f7fbb089dbc01e0242d3b67dffe3e6292e1f5182122bdf58e65215d", size = 4205926, upload-time = "2025-07-02T13:05:04.741Z" }, - { url = "https://files.pythonhosted.org/packages/07/8b/9ef5da82350175e32de245646b1884fc01124f53eb31164c77f95a08d682/cryptography-45.0.5-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e74d30ec9c7cb2f404af331d5b4099a9b322a8a6b25c4632755c8757345baac5", size = 4429235, upload-time = "2025-07-02T13:05:07.084Z" }, - { url = "https://files.pythonhosted.org/packages/7c/e1/c809f398adde1994ee53438912192d92a1d0fc0f2d7582659d9ef4c28b0c/cryptography-45.0.5-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3af26738f2db354aafe492fb3869e955b12b2ef2e16908c8b9cb928128d42c57", size = 4209785, upload-time = "2025-07-02T13:05:09.321Z" }, - { url = "https://files.pythonhosted.org/packages/d0/8b/07eb6bd5acff58406c5e806eff34a124936f41a4fb52909ffa4d00815f8c/cryptography-45.0.5-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e6c00130ed423201c5bc5544c23359141660b07999ad82e34e7bb8f882bb78e0", size = 3893050, upload-time = "2025-07-02T13:05:11.069Z" }, - { url = "https://files.pythonhosted.org/packages/ec/ef/3333295ed58d900a13c92806b67e62f27876845a9a908c939f040887cca9/cryptography-45.0.5-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:dd420e577921c8c2d31289536c386aaa30140b473835e97f83bc71ea9d2baf2d", size = 4457379, upload-time = "2025-07-02T13:05:13.32Z" }, - { url = "https://files.pythonhosted.org/packages/d9/9d/44080674dee514dbb82b21d6fa5d1055368f208304e2ab1828d85c9de8f4/cryptography-45.0.5-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:d05a38884db2ba215218745f0781775806bde4f32e07b135348355fe8e4991d9", size = 4209355, upload-time = "2025-07-02T13:05:15.017Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d8/0749f7d39f53f8258e5c18a93131919ac465ee1f9dccaf1b3f420235e0b5/cryptography-45.0.5-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:ad0caded895a00261a5b4aa9af828baede54638754b51955a0ac75576b831b27", size = 4456087, upload-time = "2025-07-02T13:05:16.945Z" }, - { url = "https://files.pythonhosted.org/packages/09/d7/92acac187387bf08902b0bf0699816f08553927bdd6ba3654da0010289b4/cryptography-45.0.5-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9024beb59aca9d31d36fcdc1604dd9bbeed0a55bface9f1908df19178e2f116e", size = 4332873, upload-time = "2025-07-02T13:05:18.743Z" }, - { url = "https://files.pythonhosted.org/packages/03/c2/840e0710da5106a7c3d4153c7215b2736151bba60bf4491bdb421df5056d/cryptography-45.0.5-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:91098f02ca81579c85f66df8a588c78f331ca19089763d733e34ad359f474174", size = 4564651, upload-time = "2025-07-02T13:05:21.382Z" }, - { url = "https://files.pythonhosted.org/packages/2e/92/cc723dd6d71e9747a887b94eb3827825c6c24b9e6ce2bb33b847d31d5eaa/cryptography-45.0.5-cp311-abi3-win32.whl", hash = "sha256:926c3ea71a6043921050eaa639137e13dbe7b4ab25800932a8498364fc1abec9", size = 2929050, upload-time = "2025-07-02T13:05:23.39Z" }, - { url = "https://files.pythonhosted.org/packages/1f/10/197da38a5911a48dd5389c043de4aec4b3c94cb836299b01253940788d78/cryptography-45.0.5-cp311-abi3-win_amd64.whl", hash = "sha256:b85980d1e345fe769cfc57c57db2b59cff5464ee0c045d52c0df087e926fbe63", size = 3403224, upload-time = "2025-07-02T13:05:25.202Z" }, - { url = "https://files.pythonhosted.org/packages/fe/2b/160ce8c2765e7a481ce57d55eba1546148583e7b6f85514472b1d151711d/cryptography-45.0.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:f3562c2f23c612f2e4a6964a61d942f891d29ee320edb62ff48ffb99f3de9ae8", size = 7017143, upload-time = "2025-07-02T13:05:27.229Z" }, - { url = "https://files.pythonhosted.org/packages/c2/e7/2187be2f871c0221a81f55ee3105d3cf3e273c0a0853651d7011eada0d7e/cryptography-45.0.5-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3fcfbefc4a7f332dece7272a88e410f611e79458fab97b5efe14e54fe476f4fd", size = 4197780, upload-time = "2025-07-02T13:05:29.299Z" }, - { url = "https://files.pythonhosted.org/packages/b9/cf/84210c447c06104e6be9122661159ad4ce7a8190011669afceeaea150524/cryptography-45.0.5-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:460f8c39ba66af7db0545a8c6f2eabcbc5a5528fc1cf6c3fa9a1e44cec33385e", size = 4420091, upload-time = "2025-07-02T13:05:31.221Z" }, - { url = "https://files.pythonhosted.org/packages/3e/6a/cb8b5c8bb82fafffa23aeff8d3a39822593cee6e2f16c5ca5c2ecca344f7/cryptography-45.0.5-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9b4cf6318915dccfe218e69bbec417fdd7c7185aa7aab139a2c0beb7468c89f0", size = 4198711, upload-time = "2025-07-02T13:05:33.062Z" }, - { url = "https://files.pythonhosted.org/packages/04/f7/36d2d69df69c94cbb2473871926daf0f01ad8e00fe3986ac3c1e8c4ca4b3/cryptography-45.0.5-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2089cc8f70a6e454601525e5bf2779e665d7865af002a5dec8d14e561002e135", size = 3883299, upload-time = "2025-07-02T13:05:34.94Z" }, - { url = "https://files.pythonhosted.org/packages/82/c7/f0ea40f016de72f81288e9fe8d1f6748036cb5ba6118774317a3ffc6022d/cryptography-45.0.5-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:0027d566d65a38497bc37e0dd7c2f8ceda73597d2ac9ba93810204f56f52ebc7", size = 4450558, upload-time = "2025-07-02T13:05:37.288Z" }, - { url = "https://files.pythonhosted.org/packages/06/ae/94b504dc1a3cdf642d710407c62e86296f7da9e66f27ab12a1ee6fdf005b/cryptography-45.0.5-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:be97d3a19c16a9be00edf79dca949c8fa7eff621763666a145f9f9535a5d7f42", size = 4198020, upload-time = "2025-07-02T13:05:39.102Z" }, - { url = "https://files.pythonhosted.org/packages/05/2b/aaf0adb845d5dabb43480f18f7ca72e94f92c280aa983ddbd0bcd6ecd037/cryptography-45.0.5-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:7760c1c2e1a7084153a0f68fab76e754083b126a47d0117c9ed15e69e2103492", size = 4449759, upload-time = "2025-07-02T13:05:41.398Z" }, - { url = "https://files.pythonhosted.org/packages/91/e4/f17e02066de63e0100a3a01b56f8f1016973a1d67551beaf585157a86b3f/cryptography-45.0.5-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6ff8728d8d890b3dda5765276d1bc6fb099252915a2cd3aff960c4c195745dd0", size = 4319991, upload-time = "2025-07-02T13:05:43.64Z" }, - { url = "https://files.pythonhosted.org/packages/f2/2e/e2dbd629481b499b14516eed933f3276eb3239f7cee2dcfa4ee6b44d4711/cryptography-45.0.5-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:7259038202a47fdecee7e62e0fd0b0738b6daa335354396c6ddebdbe1206af2a", size = 4554189, upload-time = "2025-07-02T13:05:46.045Z" }, - { url = "https://files.pythonhosted.org/packages/f8/ea/a78a0c38f4c8736287b71c2ea3799d173d5ce778c7d6e3c163a95a05ad2a/cryptography-45.0.5-cp37-abi3-win32.whl", hash = "sha256:1e1da5accc0c750056c556a93c3e9cb828970206c68867712ca5805e46dc806f", size = 2911769, upload-time = "2025-07-02T13:05:48.329Z" }, - { url = "https://files.pythonhosted.org/packages/79/b3/28ac139109d9005ad3f6b6f8976ffede6706a6478e21c889ce36c840918e/cryptography-45.0.5-cp37-abi3-win_amd64.whl", hash = "sha256:90cb0a7bb35959f37e23303b7eed0a32280510030daba3f7fdfbb65defde6a97", size = 3390016, upload-time = "2025-07-02T13:05:50.811Z" }, -] - -[[package]] -name = "gconnect" +name = "connectrpc" source = { directory = "../" } dependencies = [ { name = "anyio" }, @@ -165,6 +130,41 @@ dev = [ { name = "ruff", specifier = ">=0.8.2" }, ] +[[package]] +name = "cryptography" +version = "45.0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/95/1e/49527ac611af559665f71cbb8f92b332b5ec9c6fbc4e88b0f8e92f5e85df/cryptography-45.0.5.tar.gz", hash = "sha256:72e76caa004ab63accdf26023fccd1d087f6d90ec6048ff33ad0445abf7f605a", size = 744903, upload-time = "2025-07-02T13:06:25.941Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f0/fb/09e28bc0c46d2c547085e60897fea96310574c70fb21cd58a730a45f3403/cryptography-45.0.5-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:101ee65078f6dd3e5a028d4f19c07ffa4dd22cce6a20eaa160f8b5219911e7d8", size = 7043092, upload-time = "2025-07-02T13:05:01.514Z" }, + { url = "https://files.pythonhosted.org/packages/b1/05/2194432935e29b91fb649f6149c1a4f9e6d3d9fc880919f4ad1bcc22641e/cryptography-45.0.5-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3a264aae5f7fbb089dbc01e0242d3b67dffe3e6292e1f5182122bdf58e65215d", size = 4205926, upload-time = "2025-07-02T13:05:04.741Z" }, + { url = "https://files.pythonhosted.org/packages/07/8b/9ef5da82350175e32de245646b1884fc01124f53eb31164c77f95a08d682/cryptography-45.0.5-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e74d30ec9c7cb2f404af331d5b4099a9b322a8a6b25c4632755c8757345baac5", size = 4429235, upload-time = "2025-07-02T13:05:07.084Z" }, + { url = "https://files.pythonhosted.org/packages/7c/e1/c809f398adde1994ee53438912192d92a1d0fc0f2d7582659d9ef4c28b0c/cryptography-45.0.5-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3af26738f2db354aafe492fb3869e955b12b2ef2e16908c8b9cb928128d42c57", size = 4209785, upload-time = "2025-07-02T13:05:09.321Z" }, + { url = "https://files.pythonhosted.org/packages/d0/8b/07eb6bd5acff58406c5e806eff34a124936f41a4fb52909ffa4d00815f8c/cryptography-45.0.5-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e6c00130ed423201c5bc5544c23359141660b07999ad82e34e7bb8f882bb78e0", size = 3893050, upload-time = "2025-07-02T13:05:11.069Z" }, + { url = "https://files.pythonhosted.org/packages/ec/ef/3333295ed58d900a13c92806b67e62f27876845a9a908c939f040887cca9/cryptography-45.0.5-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:dd420e577921c8c2d31289536c386aaa30140b473835e97f83bc71ea9d2baf2d", size = 4457379, upload-time = "2025-07-02T13:05:13.32Z" }, + { url = "https://files.pythonhosted.org/packages/d9/9d/44080674dee514dbb82b21d6fa5d1055368f208304e2ab1828d85c9de8f4/cryptography-45.0.5-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:d05a38884db2ba215218745f0781775806bde4f32e07b135348355fe8e4991d9", size = 4209355, upload-time = "2025-07-02T13:05:15.017Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d8/0749f7d39f53f8258e5c18a93131919ac465ee1f9dccaf1b3f420235e0b5/cryptography-45.0.5-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:ad0caded895a00261a5b4aa9af828baede54638754b51955a0ac75576b831b27", size = 4456087, upload-time = "2025-07-02T13:05:16.945Z" }, + { url = "https://files.pythonhosted.org/packages/09/d7/92acac187387bf08902b0bf0699816f08553927bdd6ba3654da0010289b4/cryptography-45.0.5-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9024beb59aca9d31d36fcdc1604dd9bbeed0a55bface9f1908df19178e2f116e", size = 4332873, upload-time = "2025-07-02T13:05:18.743Z" }, + { url = "https://files.pythonhosted.org/packages/03/c2/840e0710da5106a7c3d4153c7215b2736151bba60bf4491bdb421df5056d/cryptography-45.0.5-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:91098f02ca81579c85f66df8a588c78f331ca19089763d733e34ad359f474174", size = 4564651, upload-time = "2025-07-02T13:05:21.382Z" }, + { url = "https://files.pythonhosted.org/packages/2e/92/cc723dd6d71e9747a887b94eb3827825c6c24b9e6ce2bb33b847d31d5eaa/cryptography-45.0.5-cp311-abi3-win32.whl", hash = "sha256:926c3ea71a6043921050eaa639137e13dbe7b4ab25800932a8498364fc1abec9", size = 2929050, upload-time = "2025-07-02T13:05:23.39Z" }, + { url = "https://files.pythonhosted.org/packages/1f/10/197da38a5911a48dd5389c043de4aec4b3c94cb836299b01253940788d78/cryptography-45.0.5-cp311-abi3-win_amd64.whl", hash = "sha256:b85980d1e345fe769cfc57c57db2b59cff5464ee0c045d52c0df087e926fbe63", size = 3403224, upload-time = "2025-07-02T13:05:25.202Z" }, + { url = "https://files.pythonhosted.org/packages/fe/2b/160ce8c2765e7a481ce57d55eba1546148583e7b6f85514472b1d151711d/cryptography-45.0.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:f3562c2f23c612f2e4a6964a61d942f891d29ee320edb62ff48ffb99f3de9ae8", size = 7017143, upload-time = "2025-07-02T13:05:27.229Z" }, + { url = "https://files.pythonhosted.org/packages/c2/e7/2187be2f871c0221a81f55ee3105d3cf3e273c0a0853651d7011eada0d7e/cryptography-45.0.5-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3fcfbefc4a7f332dece7272a88e410f611e79458fab97b5efe14e54fe476f4fd", size = 4197780, upload-time = "2025-07-02T13:05:29.299Z" }, + { url = "https://files.pythonhosted.org/packages/b9/cf/84210c447c06104e6be9122661159ad4ce7a8190011669afceeaea150524/cryptography-45.0.5-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:460f8c39ba66af7db0545a8c6f2eabcbc5a5528fc1cf6c3fa9a1e44cec33385e", size = 4420091, upload-time = "2025-07-02T13:05:31.221Z" }, + { url = "https://files.pythonhosted.org/packages/3e/6a/cb8b5c8bb82fafffa23aeff8d3a39822593cee6e2f16c5ca5c2ecca344f7/cryptography-45.0.5-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9b4cf6318915dccfe218e69bbec417fdd7c7185aa7aab139a2c0beb7468c89f0", size = 4198711, upload-time = "2025-07-02T13:05:33.062Z" }, + { url = "https://files.pythonhosted.org/packages/04/f7/36d2d69df69c94cbb2473871926daf0f01ad8e00fe3986ac3c1e8c4ca4b3/cryptography-45.0.5-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2089cc8f70a6e454601525e5bf2779e665d7865af002a5dec8d14e561002e135", size = 3883299, upload-time = "2025-07-02T13:05:34.94Z" }, + { url = "https://files.pythonhosted.org/packages/82/c7/f0ea40f016de72f81288e9fe8d1f6748036cb5ba6118774317a3ffc6022d/cryptography-45.0.5-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:0027d566d65a38497bc37e0dd7c2f8ceda73597d2ac9ba93810204f56f52ebc7", size = 4450558, upload-time = "2025-07-02T13:05:37.288Z" }, + { url = "https://files.pythonhosted.org/packages/06/ae/94b504dc1a3cdf642d710407c62e86296f7da9e66f27ab12a1ee6fdf005b/cryptography-45.0.5-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:be97d3a19c16a9be00edf79dca949c8fa7eff621763666a145f9f9535a5d7f42", size = 4198020, upload-time = "2025-07-02T13:05:39.102Z" }, + { url = "https://files.pythonhosted.org/packages/05/2b/aaf0adb845d5dabb43480f18f7ca72e94f92c280aa983ddbd0bcd6ecd037/cryptography-45.0.5-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:7760c1c2e1a7084153a0f68fab76e754083b126a47d0117c9ed15e69e2103492", size = 4449759, upload-time = "2025-07-02T13:05:41.398Z" }, + { url = "https://files.pythonhosted.org/packages/91/e4/f17e02066de63e0100a3a01b56f8f1016973a1d67551beaf585157a86b3f/cryptography-45.0.5-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6ff8728d8d890b3dda5765276d1bc6fb099252915a2cd3aff960c4c195745dd0", size = 4319991, upload-time = "2025-07-02T13:05:43.64Z" }, + { url = "https://files.pythonhosted.org/packages/f2/2e/e2dbd629481b499b14516eed933f3276eb3239f7cee2dcfa4ee6b44d4711/cryptography-45.0.5-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:7259038202a47fdecee7e62e0fd0b0738b6daa335354396c6ddebdbe1206af2a", size = 4554189, upload-time = "2025-07-02T13:05:46.045Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ea/a78a0c38f4c8736287b71c2ea3799d173d5ce778c7d6e3c163a95a05ad2a/cryptography-45.0.5-cp37-abi3-win32.whl", hash = "sha256:1e1da5accc0c750056c556a93c3e9cb828970206c68867712ca5805e46dc806f", size = 2911769, upload-time = "2025-07-02T13:05:48.329Z" }, + { url = "https://files.pythonhosted.org/packages/79/b3/28ac139109d9005ad3f6b6f8976ffede6706a6478e21c889ce36c840918e/cryptography-45.0.5-cp37-abi3-win_amd64.whl", hash = "sha256:90cb0a7bb35959f37e23303b7eed0a32280510030daba3f7fdfbb65defde6a97", size = 3390016, upload-time = "2025-07-02T13:05:50.811Z" }, +] + [[package]] name = "googleapis-common-protos" version = "1.70.0" diff --git a/examples/client.py b/examples/client.py index aef0300..d614199 100644 --- a/examples/client.py +++ b/examples/client.py @@ -20,8 +20,8 @@ import asyncio from collections.abc import AsyncGenerator -from gconnect.connect import StreamRequest, UnaryRequest -from gconnect.connection_pool import AsyncConnectionPool +from connectrpc.connect import StreamRequest, UnaryRequest +from connectrpc.connection_pool import AsyncConnectionPool from proto.connectrpc.eliza.v1.eliza_pb2 import IntroduceRequest, ReflectRequest, SayRequest from proto.connectrpc.eliza.v1.v1connect.eliza_connect_pb2 import ElizaServiceClient diff --git a/examples/cmd/examples-go/client/main.go b/examples/cmd/examples-go/client/main.go index b9ee9f1..085b286 100644 --- a/examples/cmd/examples-go/client/main.go +++ b/examples/cmd/examples-go/client/main.go @@ -88,7 +88,7 @@ func runClient() error { req := connect.NewRequest(&elizav1.SayRequest{ Sentence: "Hi", }) - req.Header().Set("Some-Header", "hello from gconnect") + req.Header().Set("Some-Header", "hello from connectrpc") res, err := client.Say(ctx, req) if err != nil { return err diff --git a/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect.py b/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect.py index a19427a..384bf01 100644 --- a/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect.py +++ b/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect.py @@ -7,7 +7,7 @@ import abc from enum import Enum -from gconnect import ( +from connectrpc import ( Client, ClientOptions, HandlerOptions, @@ -19,8 +19,8 @@ UnaryRequest, UnaryResponse, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor from .. import eliza_pb2 diff --git a/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect_pb2.py b/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect_pb2.py index 80ec432..243be75 100644 --- a/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect_pb2.py +++ b/examples/proto/connectrpc/eliza/v1/v1connect/eliza_connect_pb2.py @@ -7,7 +7,7 @@ import abc from enum import Enum -from gconnect import ( +from connectrpc import ( Client, ClientOptions, Handler, @@ -19,8 +19,8 @@ UnaryRequest, UnaryResponse, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.handler import BidiStreamHandler, ClientStreamHandler, ServerStreamHandler, UnaryHandler from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor from .. import eliza_pb2 diff --git a/examples/pyproject.toml b/examples/pyproject.toml index 4e9873f..1a76a8f 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -6,13 +6,13 @@ license = { text = "Apache-2.0" } authors = [{ name = "tsubakiky", email = "salovers1205@gmail.com" }] requires-python = ">=3.13" version = "0.1.0" -dependencies = ["gconnect", "hypercorn"] +dependencies = ["connectrpc", "hypercorn"] [tool.uv] dev-dependencies = ["mypy>=1.13.0", "pyright>=1.1.390", "ruff>=0.8.2"] [tool.uv.sources] -gconnect = { path = "../" } +connectrpc = { path = "../" } hypercorn = { git = "https://github.com/tsubakiky/hypercorn" } [tool.ruff] diff --git a/examples/server.py b/examples/server.py index 98df72a..c4fb04e 100644 --- a/examples/server.py +++ b/examples/server.py @@ -21,9 +21,9 @@ import hypercorn import hypercorn.asyncio -from gconnect.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse -from gconnect.handler_context import HandlerContext -from gconnect.middleware import ConnectMiddleware +from connectrpc.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse +from connectrpc.handler_context import HandlerContext +from connectrpc.middleware import ConnectMiddleware from starlette.applications import Starlette from starlette.middleware import Middleware diff --git a/examples/uv.lock b/examples/uv.lock index 1f502df..3692464 100644 --- a/examples/uv.lock +++ b/examples/uv.lock @@ -26,11 +26,11 @@ wheels = [ [[package]] name = "certifi" -version = "2025.7.14" +version = "2025.8.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b3/76/52c535bcebe74590f296d6c77c86dabf761c41980e1347a2422e4aa2ae41/certifi-2025.7.14.tar.gz", hash = "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995", size = 163981, upload-time = "2025-07-14T03:29:28.449Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/52/34c6cf5bb9285074dc3531c437b3919e825d976fde097a7a73f79e726d03/certifi-2025.7.14-py3-none-any.whl", hash = "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2", size = 162722, upload-time = "2025-07-14T03:29:26.863Z" }, + { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" }, ] [[package]] @@ -38,7 +38,7 @@ name = "connect-py-examples" version = "0.1.0" source = { virtual = "." } dependencies = [ - { name = "gconnect" }, + { name = "connectrpc" }, { name = "hypercorn" }, ] @@ -51,7 +51,7 @@ dev = [ [package.metadata] requires-dist = [ - { name = "gconnect", directory = "../" }, + { name = "connectrpc", directory = "../" }, { name = "hypercorn", git = "https://github.com/tsubakiky/hypercorn" }, ] @@ -63,7 +63,7 @@ dev = [ ] [[package]] -name = "gconnect" +name = "connectrpc" source = { directory = "../" } dependencies = [ { name = "anyio" }, diff --git a/pyproject.toml b/pyproject.toml index 5ce0a16..11dda13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "gconnect" +name = "connectrpc" description = "The Python implementation of Connect: Protobuf RPC that works." readme = "README.md" license = { text = "Apache-2.0" } @@ -26,10 +26,10 @@ dependencies = [ httpcore = { git = "https://github.com/tsubakiky/httpcore" } [tool.hatch.build.targets.wheel] -packages = ["src/gconnect"] +packages = ["src/connectrpc"] [tool.hatch.version] -path = "src/gconnect/version.py" +path = "src/connectrpc/version.py" [dependency-groups] dev = [ diff --git a/src/gconnect/__init__.py b/src/connectrpc/__init__.py similarity index 60% rename from src/gconnect/__init__.py rename to src/connectrpc/__init__.py index 807392d..040dbd0 100644 --- a/src/gconnect/__init__.py +++ b/src/connectrpc/__init__.py @@ -16,12 +16,12 @@ """Connect-Python: A Python implementation of the Connect protocol.""" -from gconnect.call_options import CallOptions -from gconnect.client import Client, ClientConfig -from gconnect.code import Code -from gconnect.codec import Codec, ProtoBinaryCodec, ProtoJSONCodec -from gconnect.compression import Compression, GZipCompression -from gconnect.connect import ( +from connectrpc.call_options import CallOptions +from connectrpc.client import Client, ClientConfig +from connectrpc.code import Code +from connectrpc.codec import Codec, ProtoBinaryCodec, ProtoJSONCodec +from connectrpc.compression import Compression, GZipCompression +from connectrpc.connect import ( Peer, Spec, StreamingClientConn, @@ -32,20 +32,20 @@ UnaryRequest, UnaryResponse, ) -from gconnect.content_stream import AsyncByteStream -from gconnect.error import ConnectError -from gconnect.handler import Handler -from gconnect.handler_context import HandlerContext -from gconnect.headers import Headers -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.middleware import ConnectMiddleware -from gconnect.options import ClientOptions, HandlerOptions -from gconnect.protocol import Protocol -from gconnect.request import Request -from gconnect.response import Response as HTTPResponse -from gconnect.response import StreamingResponse -from gconnect.response_writer import ServerResponseWriter -from gconnect.version import __version__ +from connectrpc.content_stream import AsyncByteStream +from connectrpc.error import ConnectError +from connectrpc.handler import Handler +from connectrpc.handler_context import HandlerContext +from connectrpc.headers import Headers +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.middleware import ConnectMiddleware +from connectrpc.options import ClientOptions, HandlerOptions +from connectrpc.protocol import Protocol +from connectrpc.request import Request +from connectrpc.response import Response as HTTPResponse +from connectrpc.response import StreamingResponse +from connectrpc.response_writer import ServerResponseWriter +from connectrpc.version import __version__ __all__ = [ "__version__", diff --git a/src/gconnect/asgi_helpers/__init__.py b/src/connectrpc/asgi_helpers/__init__.py similarity index 100% rename from src/gconnect/asgi_helpers/__init__.py rename to src/connectrpc/asgi_helpers/__init__.py diff --git a/src/gconnect/asgi_helpers/utils.py b/src/connectrpc/asgi_helpers/utils.py similarity index 97% rename from src/gconnect/asgi_helpers/utils.py rename to src/connectrpc/asgi_helpers/utils.py index fda43a8..65b8266 100644 --- a/src/gconnect/asgi_helpers/utils.py +++ b/src/connectrpc/asgi_helpers/utils.py @@ -26,7 +26,7 @@ from starlette.responses import Response from starlette.types import ASGIApp, Receive, Scope, Send -from gconnect.utils import is_async_callable, run_in_threadpool +from connectrpc.utils import is_async_callable, run_in_threadpool def request_response(func: Callable[[Request], Awaitable[Response] | Response]) -> ASGIApp: diff --git a/src/gconnect/call_options.py b/src/connectrpc/call_options.py similarity index 100% rename from src/gconnect/call_options.py rename to src/connectrpc/call_options.py diff --git a/src/gconnect/client.py b/src/connectrpc/client.py similarity index 95% rename from src/gconnect/client.py rename to src/connectrpc/client.py index 81c9c02..0ad80b3 100644 --- a/src/gconnect/client.py +++ b/src/connectrpc/client.py @@ -23,12 +23,12 @@ import httpcore from yarl import URL -from gconnect.call_options import CallOptions -from gconnect.client_interceptor import apply_interceptors -from gconnect.code import Code -from gconnect.codec import Codec, CodecNameType, ProtoBinaryCodec, ProtoJSONCodec -from gconnect.compression import COMPRESSION_IDENTITY, Compression, GZipCompression, get_compression_from_name -from gconnect.connect import ( +from connectrpc.call_options import CallOptions +from connectrpc.client_interceptor import apply_interceptors +from connectrpc.code import Code +from connectrpc.codec import Codec, CodecNameType, ProtoBinaryCodec, ProtoJSONCodec +from connectrpc.compression import COMPRESSION_IDENTITY, Compression, GZipCompression, get_compression_from_name +from connectrpc.connect import ( Spec, StreamRequest, StreamResponse, @@ -38,14 +38,14 @@ receive_stream_response, receive_unary_response, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.error import ConnectError -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.options import ClientOptions -from gconnect.protocol import Protocol, ProtocolClient, ProtocolClientParams -from gconnect.protocol_connect.connect_protocol import ProtocolConnect -from gconnect.protocol_grpc.grpc_protocol import ProtocolGRPC -from gconnect.utils import aiterate +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.error import ConnectError +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.options import ClientOptions +from connectrpc.protocol import Protocol, ProtocolClient, ProtocolClientParams +from connectrpc.protocol_connect.connect_protocol import ProtocolConnect +from connectrpc.protocol_grpc.grpc_protocol import ProtocolGRPC +from connectrpc.utils import aiterate def parse_request_url(raw_url: str) -> URL: diff --git a/src/gconnect/client_interceptor.py b/src/connectrpc/client_interceptor.py similarity index 97% rename from src/gconnect/client_interceptor.py rename to src/connectrpc/client_interceptor.py index 69a7f89..a7619ad 100644 --- a/src/gconnect/client_interceptor.py +++ b/src/connectrpc/client_interceptor.py @@ -20,8 +20,8 @@ from collections.abc import Awaitable, Callable from typing import Any, TypeGuard, overload -from gconnect.call_options import CallOptions -from gconnect.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse +from connectrpc.call_options import CallOptions +from connectrpc.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse UnaryFunc = Callable[[UnaryRequest[Any], CallOptions], Awaitable[UnaryResponse[Any]]] StreamFunc = Callable[[StreamRequest[Any], CallOptions], Awaitable[StreamResponse[Any]]] diff --git a/src/gconnect/code.py b/src/connectrpc/code.py similarity index 100% rename from src/gconnect/code.py rename to src/connectrpc/code.py diff --git a/src/gconnect/codec.py b/src/connectrpc/codec.py similarity index 100% rename from src/gconnect/codec.py rename to src/connectrpc/codec.py diff --git a/src/gconnect/compression.py b/src/connectrpc/compression.py similarity index 100% rename from src/gconnect/compression.py rename to src/connectrpc/compression.py diff --git a/src/gconnect/connect.py b/src/connectrpc/connect.py similarity index 99% rename from src/gconnect/connect.py rename to src/connectrpc/connect.py index 1deb9aa..85690ec 100644 --- a/src/gconnect/connect.py +++ b/src/connectrpc/connect.py @@ -25,12 +25,12 @@ from pydantic import BaseModel -from gconnect.code import Code -from gconnect.content_stream import AsyncDataStream -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.utils import aiterate, get_acallable_attribute, get_callable_attribute +from connectrpc.code import Code +from connectrpc.content_stream import AsyncDataStream +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.utils import aiterate, get_acallable_attribute, get_callable_attribute class StreamType(Enum): diff --git a/src/gconnect/connection_pool.py b/src/connectrpc/connection_pool.py similarity index 100% rename from src/gconnect/connection_pool.py rename to src/connectrpc/connection_pool.py diff --git a/src/gconnect/content_stream.py b/src/connectrpc/content_stream.py similarity index 99% rename from src/gconnect/content_stream.py rename to src/connectrpc/content_stream.py index d7f4489..ed20143 100644 --- a/src/gconnect/content_stream.py +++ b/src/connectrpc/content_stream.py @@ -23,7 +23,7 @@ Callable, ) -from gconnect.utils import ( +from connectrpc.utils import ( get_acallable_attribute, map_httpcore_exceptions, ) diff --git a/src/gconnect/envelope.py b/src/connectrpc/envelope.py similarity index 98% rename from src/gconnect/envelope.py rename to src/connectrpc/envelope.py index b8f8b11..0d98d39 100644 --- a/src/gconnect/envelope.py +++ b/src/connectrpc/envelope.py @@ -21,11 +21,11 @@ from enum import Flag from typing import Any -from gconnect.code import Code -from gconnect.codec import Codec -from gconnect.compression import Compression -from gconnect.error import ConnectError -from gconnect.utils import get_acallable_attribute +from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression +from connectrpc.error import ConnectError +from connectrpc.utils import get_acallable_attribute class EnvelopeFlags(Flag): diff --git a/src/gconnect/error.py b/src/connectrpc/error.py similarity index 99% rename from src/gconnect/error.py rename to src/connectrpc/error.py index 43322e9..154e915 100644 --- a/src/gconnect/error.py +++ b/src/connectrpc/error.py @@ -20,8 +20,8 @@ import google.protobuf.symbol_database as symbol_database from google.protobuf.message import Message -from gconnect.code import Code -from gconnect.headers import Headers +from connectrpc.code import Code +from connectrpc.headers import Headers DEFAULT_ANY_RESOLVER_PREFIX = "type.googleapis.com/" diff --git a/src/gconnect/handler.py b/src/connectrpc/handler.py similarity index 97% rename from src/gconnect/handler.py rename to src/connectrpc/handler.py index 6244f33..eec62b5 100644 --- a/src/gconnect/handler.py +++ b/src/connectrpc/handler.py @@ -24,10 +24,10 @@ import anyio from starlette.responses import PlainTextResponse, Response -from gconnect.code import Code -from gconnect.codec import Codec, CodecMap, CodecNameType, ProtoBinaryCodec, ProtoJSONCodec -from gconnect.compression import Compression, GZipCompression -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.codec import Codec, CodecMap, CodecNameType, ProtoBinaryCodec, ProtoJSONCodec +from connectrpc.compression import Compression, GZipCompression +from connectrpc.connect import ( Spec, StreamingHandlerConn, StreamRequest, @@ -38,13 +38,13 @@ receive_stream_request, receive_unary_request, ) -from gconnect.error import ConnectError -from gconnect.handler_context import HandlerContext -from gconnect.handler_interceptor import apply_interceptors -from gconnect.headers import Headers -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.options import HandlerOptions -from gconnect.protocol import ( +from connectrpc.error import ConnectError +from connectrpc.handler_context import HandlerContext +from connectrpc.handler_interceptor import apply_interceptors +from connectrpc.headers import Headers +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.options import HandlerOptions +from connectrpc.protocol import ( HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, ProtocolHandler, @@ -54,13 +54,13 @@ sorted_accept_post_value, sorted_allow_method_value, ) -from gconnect.protocol_connect.connect_protocol import ( +from connectrpc.protocol_connect.connect_protocol import ( ProtocolConnect, ) -from gconnect.protocol_grpc.grpc_protocol import ProtocolGRPC -from gconnect.request import Request -from gconnect.response_writer import ServerResponseWriter -from gconnect.utils import aiterate +from connectrpc.protocol_grpc.grpc_protocol import ProtocolGRPC +from connectrpc.request import Request +from connectrpc.response_writer import ServerResponseWriter +from connectrpc.utils import aiterate type UnaryFunc[T_Request, T_Response] = Callable[ [UnaryRequest[T_Request], HandlerContext], Awaitable[UnaryResponse[T_Response]] diff --git a/src/gconnect/handler_context.py b/src/connectrpc/handler_context.py similarity index 100% rename from src/gconnect/handler_context.py rename to src/connectrpc/handler_context.py diff --git a/src/gconnect/handler_interceptor.py b/src/connectrpc/handler_interceptor.py similarity index 97% rename from src/gconnect/handler_interceptor.py rename to src/connectrpc/handler_interceptor.py index 700a9c6..37abdf8 100644 --- a/src/gconnect/handler_interceptor.py +++ b/src/connectrpc/handler_interceptor.py @@ -20,8 +20,8 @@ from collections.abc import Awaitable, Callable from typing import Any, TypeGuard, overload -from gconnect.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse -from gconnect.handler_context import HandlerContext +from connectrpc.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse +from connectrpc.handler_context import HandlerContext UnaryFunc = Callable[[UnaryRequest[Any], HandlerContext], Awaitable[UnaryResponse[Any]]] StreamFunc = Callable[[StreamRequest[Any], HandlerContext], Awaitable[StreamResponse[Any]]] diff --git a/src/gconnect/headers.py b/src/connectrpc/headers.py similarity index 100% rename from src/gconnect/headers.py rename to src/connectrpc/headers.py diff --git a/src/gconnect/idempotency_level.py b/src/connectrpc/idempotency_level.py similarity index 100% rename from src/gconnect/idempotency_level.py rename to src/connectrpc/idempotency_level.py diff --git a/src/gconnect/middleware.py b/src/connectrpc/middleware.py similarity index 96% rename from src/gconnect/middleware.py rename to src/connectrpc/middleware.py index f3c24b0..b33a22e 100644 --- a/src/gconnect/middleware.py +++ b/src/connectrpc/middleware.py @@ -22,8 +22,8 @@ from starlette.responses import Response from starlette.types import ASGIApp, Receive, Scope, Send -from gconnect.asgi_helpers.utils import get_route_path, request_response -from gconnect.handler import Handler +from connectrpc.asgi_helpers.utils import get_route_path, request_response +from connectrpc.handler import Handler HandleFunc = Callable[[Request], Awaitable[Response]] diff --git a/src/gconnect/options.py b/src/connectrpc/options.py similarity index 97% rename from src/gconnect/options.py rename to src/connectrpc/options.py index 0f8c48f..479852d 100644 --- a/src/gconnect/options.py +++ b/src/connectrpc/options.py @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict, Field -from gconnect.client_interceptor import ClientInterceptor -from gconnect.handler_interceptor import HandlerInterceptor -from gconnect.idempotency_level import IdempotencyLevel +from connectrpc.client_interceptor import ClientInterceptor +from connectrpc.handler_interceptor import HandlerInterceptor +from connectrpc.idempotency_level import IdempotencyLevel class HandlerOptions(BaseModel): diff --git a/src/gconnect/protocol.py b/src/connectrpc/protocol.py similarity index 97% rename from src/gconnect/protocol.py rename to src/connectrpc/protocol.py index e4f9ca6..b83bf2a 100644 --- a/src/gconnect/protocol.py +++ b/src/connectrpc/protocol.py @@ -22,22 +22,22 @@ from pydantic import BaseModel, ConfigDict, Field from yarl import URL -from gconnect.code import Code -from gconnect.codec import Codec, ReadOnlyCodecs -from gconnect.compression import COMPRESSION_IDENTITY, Compression -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.codec import Codec, ReadOnlyCodecs +from connectrpc.compression import COMPRESSION_IDENTITY, Compression +from connectrpc.connect import ( Peer, Spec, StreamingClientConn, StreamingHandlerConn, StreamType, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.request import Request -from gconnect.response_writer import ServerResponseWriter +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.request import Request +from connectrpc.response_writer import ServerResponseWriter PROTOCOL_CONNECT = "connect" PROTOCOL_GRPC = "grpc" diff --git a/src/gconnect/protocol_connect/__init__.py b/src/connectrpc/protocol_connect/__init__.py similarity index 100% rename from src/gconnect/protocol_connect/__init__.py rename to src/connectrpc/protocol_connect/__init__.py diff --git a/src/gconnect/protocol_connect/base64_utils.py b/src/connectrpc/protocol_connect/base64_utils.py similarity index 100% rename from src/gconnect/protocol_connect/base64_utils.py rename to src/connectrpc/protocol_connect/base64_utils.py diff --git a/src/gconnect/protocol_connect/connect_client.py b/src/connectrpc/protocol_connect/connect_client.py similarity index 97% rename from src/gconnect/protocol_connect/connect_client.py rename to src/connectrpc/protocol_connect/connect_client.py index a2c4f52..8b50c39 100644 --- a/src/gconnect/protocol_connect/connect_client.py +++ b/src/connectrpc/protocol_connect/connect_client.py @@ -31,10 +31,10 @@ import httpcore from yarl import URL -from gconnect.code import Code -from gconnect.codec import Codec, StableCodec -from gconnect.compression import COMPRESSION_IDENTITY, Compression, get_compression_from_name -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.codec import Codec, StableCodec +from connectrpc.compression import COMPRESSION_IDENTITY, Compression, get_compression_from_name +from connectrpc.connect import ( Address, Peer, Spec, @@ -42,12 +42,12 @@ StreamType, ensure_single, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.content_stream import BoundAsyncStream -from gconnect.error import ConnectError -from gconnect.headers import Headers, include_request_headers -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.protocol import ( +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.content_stream import BoundAsyncStream +from connectrpc.error import ConnectError +from connectrpc.headers import Headers, include_request_headers +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.protocol import ( HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_USER_AGENT, @@ -56,7 +56,7 @@ ProtocolClientParams, code_from_http_status, ) -from gconnect.protocol_connect.constants import ( +from connectrpc.protocol_connect.constants import ( CONNECT_HEADER_PROTOCOL_VERSION, CONNECT_HEADER_TIMEOUT, CONNECT_PROTOCOL_VERSION, @@ -68,15 +68,15 @@ CONNECT_UNARY_TRAILER_PREFIX, DEFAULT_CONNECT_USER_AGENT, ) -from gconnect.protocol_connect.content_type import ( +from connectrpc.protocol_connect.content_type import ( connect_codec_from_content_type, connect_content_type_from_codec_name, connect_validate_unary_response_content_type, ) -from gconnect.protocol_connect.error_json import error_from_json -from gconnect.protocol_connect.marshaler import ConnectStreamingMarshaler, ConnectUnaryRequestMarshaler -from gconnect.protocol_connect.unmarshaler import ConnectStreamingUnmarshaler, ConnectUnaryUnmarshaler -from gconnect.utils import ( +from connectrpc.protocol_connect.error_json import error_from_json +from connectrpc.protocol_connect.marshaler import ConnectStreamingMarshaler, ConnectUnaryRequestMarshaler +from connectrpc.protocol_connect.unmarshaler import ConnectStreamingUnmarshaler, ConnectUnaryUnmarshaler +from connectrpc.utils import ( map_httpcore_exceptions, ) diff --git a/src/gconnect/protocol_connect/connect_handler.py b/src/connectrpc/protocol_connect/connect_handler.py similarity index 96% rename from src/gconnect/protocol_connect/connect_handler.py rename to src/connectrpc/protocol_connect/connect_handler.py index 544c00b..2000829 100644 --- a/src/gconnect/protocol_connect/connect_handler.py +++ b/src/connectrpc/protocol_connect/connect_handler.py @@ -25,9 +25,9 @@ from typing import Any from urllib.parse import unquote -from gconnect.code import Code -from gconnect.compression import COMPRESSION_IDENTITY -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.compression import COMPRESSION_IDENTITY +from connectrpc.connect import ( Address, Peer, Spec, @@ -35,9 +35,9 @@ StreamType, ensure_single, ) -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.protocol import ( +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.protocol import ( HEADER_CONTENT_TYPE, PROTOCOL_CONNECT, ProtocolHandler, @@ -45,8 +45,8 @@ exclude_protocol_headers, negotiate_compression, ) -from gconnect.protocol_connect.base64_utils import decode_urlsafe_base64_with_padding -from gconnect.protocol_connect.constants import ( +from connectrpc.protocol_connect.base64_utils import decode_urlsafe_base64_with_padding +from connectrpc.protocol_connect.constants import ( CONNECT_HEADER_PROTOCOL_VERSION, CONNECT_HEADER_TIMEOUT, CONNECT_PROTOCOL_VERSION, @@ -63,15 +63,18 @@ CONNECT_UNARY_MESSAGE_QUERY_PARAMETER, CONNECT_UNARY_TRAILER_PREFIX, ) -from gconnect.protocol_connect.content_type import connect_codec_from_content_type, connect_content_type_from_codec_name -from gconnect.protocol_connect.error_code import connect_code_to_http -from gconnect.protocol_connect.error_json import error_to_json -from gconnect.protocol_connect.marshaler import ConnectStreamingMarshaler, ConnectUnaryMarshaler -from gconnect.protocol_connect.unmarshaler import ConnectStreamingUnmarshaler, ConnectUnaryUnmarshaler -from gconnect.request import Request -from gconnect.response import Response, StreamingResponse -from gconnect.response_writer import ServerResponseWriter -from gconnect.utils import ( +from connectrpc.protocol_connect.content_type import ( + connect_codec_from_content_type, + connect_content_type_from_codec_name, +) +from connectrpc.protocol_connect.error_code import connect_code_to_http +from connectrpc.protocol_connect.error_json import error_to_json +from connectrpc.protocol_connect.marshaler import ConnectStreamingMarshaler, ConnectUnaryMarshaler +from connectrpc.protocol_connect.unmarshaler import ConnectStreamingUnmarshaler, ConnectUnaryUnmarshaler +from connectrpc.request import Request +from connectrpc.response import Response, StreamingResponse +from connectrpc.response_writer import ServerResponseWriter +from connectrpc.utils import ( aiterate, ) diff --git a/src/gconnect/protocol_connect/connect_protocol.py b/src/connectrpc/protocol_connect/connect_protocol.py similarity index 91% rename from src/gconnect/protocol_connect/connect_protocol.py rename to src/connectrpc/protocol_connect/connect_protocol.py index c74da38..0d2357d 100644 --- a/src/gconnect/protocol_connect/connect_protocol.py +++ b/src/connectrpc/protocol_connect/connect_protocol.py @@ -18,19 +18,19 @@ from http import HTTPMethod -from gconnect.connect import ( +from connectrpc.connect import ( StreamType, ) -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.protocol import ( +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.protocol import ( Protocol, ProtocolClient, ProtocolClientParams, ProtocolHandlerParams, ) -from gconnect.protocol_connect.connect_client import ConnectClient -from gconnect.protocol_connect.connect_handler import ConnectHandler -from gconnect.protocol_connect.constants import ( +from connectrpc.protocol_connect.connect_client import ConnectClient +from connectrpc.protocol_connect.connect_handler import ConnectHandler +from connectrpc.protocol_connect.constants import ( CONNECT_STREAMING_CONTENT_TYPE_PREFIX, CONNECT_UNARY_CONTENT_TYPE_PREFIX, ) diff --git a/src/gconnect/protocol_connect/constants.py b/src/connectrpc/protocol_connect/constants.py similarity index 93% rename from src/gconnect/protocol_connect/constants.py rename to src/connectrpc/protocol_connect/constants.py index 3bf33c7..3a0e5c6 100644 --- a/src/gconnect/protocol_connect/constants.py +++ b/src/connectrpc/protocol_connect/constants.py @@ -18,7 +18,7 @@ import sys -from gconnect.version import __version__ +from connectrpc.version import __version__ CONNECT_UNARY_HEADER_COMPRESSION = "Content-Encoding" CONNECT_UNARY_HEADER_ACCEPT_COMPRESSION = "Accept-Encoding" @@ -41,4 +41,4 @@ CONNECT_UNARY_CONNECT_QUERY_VALUE = "v" + CONNECT_PROTOCOL_VERSION _python_version = f"{sys.version_info.major}.{sys.version_info.minor}" -DEFAULT_CONNECT_USER_AGENT = f"gconnect/{__version__} (Python/{_python_version})" +DEFAULT_CONNECT_USER_AGENT = f"connectrpc/{__version__} (Python/{_python_version})" diff --git a/src/gconnect/protocol_connect/content_type.py b/src/connectrpc/protocol_connect/content_type.py similarity index 95% rename from src/gconnect/protocol_connect/content_type.py rename to src/connectrpc/protocol_connect/content_type.py index 4f49f1b..ceadad2 100644 --- a/src/gconnect/protocol_connect/content_type.py +++ b/src/connectrpc/protocol_connect/content_type.py @@ -18,16 +18,16 @@ from http import HTTPStatus -from gconnect.code import Code -from gconnect.codec import CodecNameType -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.codec import CodecNameType +from connectrpc.connect import ( StreamType, ) -from gconnect.error import ConnectError -from gconnect.protocol import ( +from connectrpc.error import ConnectError +from connectrpc.protocol import ( code_from_http_status, ) -from gconnect.protocol_connect.constants import ( +from connectrpc.protocol_connect.constants import ( CONNECT_STREAMING_CONTENT_TYPE_PREFIX, CONNECT_UNARY_CONTENT_TYPE_PREFIX, ) diff --git a/src/gconnect/protocol_connect/end_stream.py b/src/connectrpc/protocol_connect/end_stream.py similarity index 94% rename from src/gconnect/protocol_connect/end_stream.py rename to src/connectrpc/protocol_connect/end_stream.py index b361291..6d8438f 100644 --- a/src/gconnect/protocol_connect/end_stream.py +++ b/src/connectrpc/protocol_connect/end_stream.py @@ -19,10 +19,10 @@ import json from typing import Any -from gconnect.code import Code -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.protocol_connect.error_json import error_from_json, error_to_json +from connectrpc.code import Code +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.protocol_connect.error_json import error_from_json, error_to_json def end_stream_to_json(error: ConnectError | None, trailers: Headers) -> dict[str, Any]: diff --git a/src/gconnect/protocol_connect/error_code.py b/src/connectrpc/protocol_connect/error_code.py similarity index 98% rename from src/gconnect/protocol_connect/error_code.py rename to src/connectrpc/protocol_connect/error_code.py index 6ec2072..0618e0d 100644 --- a/src/gconnect/protocol_connect/error_code.py +++ b/src/connectrpc/protocol_connect/error_code.py @@ -16,7 +16,7 @@ """HTTP status code mapping for Connect protocol error codes.""" -from gconnect.code import Code +from connectrpc.code import Code def connect_code_to_http(code: Code) -> int: diff --git a/src/gconnect/protocol_connect/error_json.py b/src/connectrpc/protocol_connect/error_json.py similarity index 96% rename from src/gconnect/protocol_connect/error_json.py rename to src/connectrpc/protocol_connect/error_json.py index 3f0fdf5..e223177 100644 --- a/src/gconnect/protocol_connect/error_json.py +++ b/src/connectrpc/protocol_connect/error_json.py @@ -24,9 +24,9 @@ import google.protobuf.any_pb2 as any_pb2 from google.protobuf import json_format -from gconnect.code import Code -from gconnect.error import DEFAULT_ANY_RESOLVER_PREFIX, ConnectError, ErrorDetail -from gconnect.protocol_connect.base64_utils import decode_base64_with_padding, encode_base64_without_padding +from connectrpc.code import Code +from connectrpc.error import DEFAULT_ANY_RESOLVER_PREFIX, ConnectError, ErrorDetail +from connectrpc.protocol_connect.base64_utils import decode_base64_with_padding, encode_base64_without_padding _string_to_code: dict[str, Code] | None = None _code_mapping_lock = threading.Lock() diff --git a/src/gconnect/protocol_connect/marshaler.py b/src/connectrpc/protocol_connect/marshaler.py similarity index 97% rename from src/gconnect/protocol_connect/marshaler.py rename to src/connectrpc/protocol_connect/marshaler.py index a3321df..b301a0e 100644 --- a/src/gconnect/protocol_connect/marshaler.py +++ b/src/connectrpc/protocol_connect/marshaler.py @@ -23,18 +23,18 @@ from yarl import URL -from gconnect.code import Code -from gconnect.codec import Codec, StableCodec -from gconnect.compression import Compression -from gconnect.envelope import EnvelopeFlags, EnvelopeWriter -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.protocol import ( +from connectrpc.code import Code +from connectrpc.codec import Codec, StableCodec +from connectrpc.compression import Compression +from connectrpc.envelope import EnvelopeFlags, EnvelopeWriter +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.protocol import ( HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, ) -from gconnect.protocol_connect.constants import ( +from connectrpc.protocol_connect.constants import ( CONNECT_HEADER_PROTOCOL_VERSION, CONNECT_UNARY_BASE64_QUERY_PARAMETER, CONNECT_UNARY_COMPRESSION_QUERY_PARAMETER, @@ -44,7 +44,7 @@ CONNECT_UNARY_HEADER_COMPRESSION, CONNECT_UNARY_MESSAGE_QUERY_PARAMETER, ) -from gconnect.protocol_connect.end_stream import end_stream_to_json +from connectrpc.protocol_connect.end_stream import end_stream_to_json class ConnectUnaryMarshaler: diff --git a/src/gconnect/protocol_connect/unmarshaler.py b/src/connectrpc/protocol_connect/unmarshaler.py similarity index 96% rename from src/gconnect/protocol_connect/unmarshaler.py rename to src/connectrpc/protocol_connect/unmarshaler.py index a14f717..e156675 100644 --- a/src/gconnect/protocol_connect/unmarshaler.py +++ b/src/connectrpc/protocol_connect/unmarshaler.py @@ -23,14 +23,14 @@ ) from typing import Any -from gconnect.code import Code -from gconnect.codec import Codec -from gconnect.compression import Compression -from gconnect.envelope import EnvelopeReader -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.protocol_connect.end_stream import end_stream_from_bytes -from gconnect.utils import get_acallable_attribute +from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression +from connectrpc.envelope import EnvelopeReader +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.protocol_connect.end_stream import end_stream_from_bytes +from connectrpc.utils import get_acallable_attribute class ConnectUnaryUnmarshaler: diff --git a/src/gconnect/protocol_grpc/__init__.py b/src/connectrpc/protocol_grpc/__init__.py similarity index 100% rename from src/gconnect/protocol_grpc/__init__.py rename to src/connectrpc/protocol_grpc/__init__.py diff --git a/src/gconnect/protocol_grpc/constants.py b/src/connectrpc/protocol_grpc/constants.py similarity index 93% rename from src/gconnect/protocol_grpc/constants.py rename to src/connectrpc/protocol_grpc/constants.py index 0016772..5b15ee3 100644 --- a/src/gconnect/protocol_grpc/constants.py +++ b/src/connectrpc/protocol_grpc/constants.py @@ -20,7 +20,7 @@ import sys from http import HTTPMethod -from gconnect.version import __version__ +from connectrpc.version import __version__ GRPC_HEADER_COMPRESSION = "Grpc-Encoding" GRPC_HEADER_ACCEPT_COMPRESSION = "Grpc-Accept-Encoding" @@ -38,7 +38,7 @@ GRPC_ALLOWED_METHODS = [HTTPMethod.POST] _python_version = f"{sys.version_info.major}.{sys.version_info.minor}" -DEFAULT_GRPC_USER_AGENT = f"gconnect/{__version__} (Python/{_python_version})" +DEFAULT_GRPC_USER_AGENT = f"connectrpc/{__version__} (Python/{_python_version})" RE_TIMEOUT = re.compile(r"^(\d{1,8})([HMSmun])$") diff --git a/src/gconnect/protocol_grpc/content_type.py b/src/connectrpc/protocol_grpc/content_type.py similarity index 96% rename from src/gconnect/protocol_grpc/content_type.py rename to src/connectrpc/protocol_grpc/content_type.py index bed6f08..6f005c7 100644 --- a/src/gconnect/protocol_grpc/content_type.py +++ b/src/connectrpc/protocol_grpc/content_type.py @@ -16,10 +16,10 @@ """Utilities for handling gRPC and gRPC-Web content types and codec validation.""" -from gconnect.code import Code -from gconnect.codec import CodecNameType -from gconnect.error import ConnectError -from gconnect.protocol_grpc.constants import ( +from connectrpc.code import Code +from connectrpc.codec import CodecNameType +from connectrpc.error import ConnectError +from connectrpc.protocol_grpc.constants import ( GRPC_CONTENT_TYPE_DEFAULT, GRPC_CONTENT_TYPE_PREFIX, GRPC_WEB_CONTENT_TYPE_DEFAULT, diff --git a/src/gconnect/protocol_grpc/error_trailer.py b/src/connectrpc/protocol_grpc/error_trailer.py similarity index 96% rename from src/gconnect/protocol_grpc/error_trailer.py rename to src/connectrpc/protocol_grpc/error_trailer.py index b09c9d3..b6e4da8 100644 --- a/src/gconnect/protocol_grpc/error_trailer.py +++ b/src/connectrpc/protocol_grpc/error_trailer.py @@ -22,11 +22,11 @@ from google.protobuf.message import DecodeError from google.rpc import status_pb2 -from gconnect.code import Code -from gconnect.error import ConnectError, ErrorDetail -from gconnect.headers import Headers -from gconnect.protocol import exclude_protocol_headers -from gconnect.protocol_grpc.constants import ( +from connectrpc.code import Code +from connectrpc.error import ConnectError, ErrorDetail +from connectrpc.headers import Headers +from connectrpc.protocol import exclude_protocol_headers +from connectrpc.protocol_grpc.constants import ( GRPC_HEADER_DETAILS, GRPC_HEADER_MESSAGE, GRPC_HEADER_STATUS, diff --git a/src/gconnect/protocol_grpc/grpc_client.py b/src/connectrpc/protocol_grpc/grpc_client.py similarity index 95% rename from src/gconnect/protocol_grpc/grpc_client.py rename to src/connectrpc/protocol_grpc/grpc_client.py index e94cf73..41e74e9 100644 --- a/src/gconnect/protocol_grpc/grpc_client.py +++ b/src/connectrpc/protocol_grpc/grpc_client.py @@ -26,27 +26,27 @@ import httpcore from yarl import URL -from gconnect.code import Code -from gconnect.codec import Codec -from gconnect.compression import COMPRESSION_IDENTITY, Compression, get_compression_from_name -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import COMPRESSION_IDENTITY, Compression, get_compression_from_name +from connectrpc.connect import ( Peer, Spec, StreamingClientConn, StreamType, ) -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.content_stream import BoundAsyncStream -from gconnect.error import ConnectError -from gconnect.headers import Headers, include_request_headers -from gconnect.protocol import ( +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.content_stream import BoundAsyncStream +from connectrpc.error import ConnectError +from connectrpc.headers import Headers, include_request_headers +from connectrpc.protocol import ( HEADER_CONTENT_TYPE, HEADER_USER_AGENT, ProtocolClient, ProtocolClientParams, code_from_http_status, ) -from gconnect.protocol_grpc.constants import ( +from connectrpc.protocol_grpc.constants import ( DEFAULT_GRPC_USER_AGENT, GRPC_HEADER_ACCEPT_COMPRESSION, GRPC_HEADER_COMPRESSION, @@ -55,11 +55,11 @@ HEADER_X_USER_AGENT, UNIT_TO_SECONDS, ) -from gconnect.protocol_grpc.content_type import grpc_content_type_from_codec_name, grpc_validate_response_content_type -from gconnect.protocol_grpc.error_trailer import grpc_error_from_trailer -from gconnect.protocol_grpc.marshaler import GRPCMarshaler -from gconnect.protocol_grpc.unmarshaler import GRPCUnmarshaler -from gconnect.utils import map_httpcore_exceptions +from connectrpc.protocol_grpc.content_type import grpc_content_type_from_codec_name, grpc_validate_response_content_type +from connectrpc.protocol_grpc.error_trailer import grpc_error_from_trailer +from connectrpc.protocol_grpc.marshaler import GRPCMarshaler +from connectrpc.protocol_grpc.unmarshaler import GRPCUnmarshaler +from connectrpc.utils import map_httpcore_exceptions EventHook = Callable[..., Any] diff --git a/src/gconnect/protocol_grpc/grpc_handler.py b/src/connectrpc/protocol_grpc/grpc_handler.py similarity index 95% rename from src/gconnect/protocol_grpc/grpc_handler.py rename to src/connectrpc/protocol_grpc/grpc_handler.py index d7db156..a8fa803 100644 --- a/src/gconnect/protocol_grpc/grpc_handler.py +++ b/src/connectrpc/protocol_grpc/grpc_handler.py @@ -20,24 +20,24 @@ from http import HTTPMethod from typing import Any -from gconnect.code import Code -from gconnect.compression import COMPRESSION_IDENTITY -from gconnect.connect import ( +from connectrpc.code import Code +from connectrpc.compression import COMPRESSION_IDENTITY +from connectrpc.connect import ( Address, Peer, Spec, StreamingHandlerConn, ) -from gconnect.error import ConnectError -from gconnect.headers import Headers -from gconnect.protocol import ( +from connectrpc.error import ConnectError +from connectrpc.headers import Headers +from connectrpc.protocol import ( HEADER_CONTENT_TYPE, PROTOCOL_GRPC, ProtocolHandler, ProtocolHandlerParams, negotiate_compression, ) -from gconnect.protocol_grpc.constants import ( +from connectrpc.protocol_grpc.constants import ( GRPC_ALLOWED_METHODS, GRPC_HEADER_ACCEPT_COMPRESSION, GRPC_HEADER_COMPRESSION, @@ -47,14 +47,14 @@ RE_TIMEOUT, UNIT_TO_SECONDS, ) -from gconnect.protocol_grpc.content_type import grpc_codec_from_content_type -from gconnect.protocol_grpc.error_trailer import grpc_error_to_trailer -from gconnect.protocol_grpc.marshaler import GRPCMarshaler -from gconnect.protocol_grpc.unmarshaler import GRPCUnmarshaler -from gconnect.request import Request -from gconnect.response import StreamingResponse -from gconnect.response_writer import ServerResponseWriter -from gconnect.utils import aiterate +from connectrpc.protocol_grpc.content_type import grpc_codec_from_content_type +from connectrpc.protocol_grpc.error_trailer import grpc_error_to_trailer +from connectrpc.protocol_grpc.marshaler import GRPCMarshaler +from connectrpc.protocol_grpc.unmarshaler import GRPCUnmarshaler +from connectrpc.request import Request +from connectrpc.response import StreamingResponse +from connectrpc.response_writer import ServerResponseWriter +from connectrpc.utils import aiterate class GRPCHandler(ProtocolHandler): diff --git a/src/gconnect/protocol_grpc/grpc_protocol.py b/src/connectrpc/protocol_grpc/grpc_protocol.py similarity index 94% rename from src/gconnect/protocol_grpc/grpc_protocol.py rename to src/connectrpc/protocol_grpc/grpc_protocol.py index 48b7a36..47be4dc 100644 --- a/src/gconnect/protocol_grpc/grpc_protocol.py +++ b/src/connectrpc/protocol_grpc/grpc_protocol.py @@ -16,12 +16,12 @@ """gRPC and gRPC-Web protocol implementation for Connect framework.""" -from gconnect.codec import CodecNameType -from gconnect.connect import ( +from connectrpc.codec import CodecNameType +from connectrpc.connect import ( Address, Peer, ) -from gconnect.protocol import ( +from connectrpc.protocol import ( PROTOCOL_GRPC, PROTOCOL_GRPC_WEB, Protocol, @@ -30,14 +30,14 @@ ProtocolHandler, ProtocolHandlerParams, ) -from gconnect.protocol_grpc.constants import ( +from connectrpc.protocol_grpc.constants import ( GRPC_CONTENT_TYPE_DEFAULT, GRPC_CONTENT_TYPE_PREFIX, GRPC_WEB_CONTENT_TYPE_DEFAULT, GRPC_WEB_CONTENT_TYPE_PREFIX, ) -from gconnect.protocol_grpc.grpc_client import GRPCClient -from gconnect.protocol_grpc.grpc_handler import GRPCHandler +from connectrpc.protocol_grpc.grpc_client import GRPCClient +from connectrpc.protocol_grpc.grpc_handler import GRPCHandler class ProtocolGRPC(Protocol): diff --git a/src/gconnect/protocol_grpc/marshaler.py b/src/connectrpc/protocol_grpc/marshaler.py similarity index 94% rename from src/gconnect/protocol_grpc/marshaler.py rename to src/connectrpc/protocol_grpc/marshaler.py index 54c376f..d8ffd30 100644 --- a/src/gconnect/protocol_grpc/marshaler.py +++ b/src/connectrpc/protocol_grpc/marshaler.py @@ -16,10 +16,10 @@ """gRPC-Web marshaler for serializing messages and trailers with optional compression.""" -from gconnect.codec import Codec -from gconnect.compression import Compression -from gconnect.envelope import EnvelopeFlags, EnvelopeWriter -from gconnect.headers import Headers +from connectrpc.codec import Codec +from connectrpc.compression import Compression +from connectrpc.envelope import EnvelopeFlags, EnvelopeWriter +from connectrpc.headers import Headers class GRPCMarshaler(EnvelopeWriter): diff --git a/src/gconnect/protocol_grpc/unmarshaler.py b/src/connectrpc/protocol_grpc/unmarshaler.py similarity index 95% rename from src/gconnect/protocol_grpc/unmarshaler.py rename to src/connectrpc/protocol_grpc/unmarshaler.py index 955dbcf..9fe834c 100644 --- a/src/gconnect/protocol_grpc/unmarshaler.py +++ b/src/connectrpc/protocol_grpc/unmarshaler.py @@ -20,11 +20,11 @@ from copy import copy from typing import Any -from gconnect.codec import Codec -from gconnect.compression import Compression -from gconnect.envelope import EnvelopeFlags, EnvelopeReader -from gconnect.error import ConnectError -from gconnect.headers import Headers +from connectrpc.codec import Codec +from connectrpc.compression import Compression +from connectrpc.envelope import EnvelopeFlags, EnvelopeReader +from connectrpc.error import ConnectError +from connectrpc.headers import Headers class GRPCUnmarshaler(EnvelopeReader): diff --git a/src/gconnect/request.py b/src/connectrpc/request.py similarity index 100% rename from src/gconnect/request.py rename to src/connectrpc/request.py diff --git a/src/gconnect/response.py b/src/connectrpc/response.py similarity index 100% rename from src/gconnect/response.py rename to src/connectrpc/response.py diff --git a/src/gconnect/response_writer.py b/src/connectrpc/response_writer.py similarity index 98% rename from src/gconnect/response_writer.py rename to src/connectrpc/response_writer.py index ca9a93b..2a1a94e 100644 --- a/src/gconnect/response_writer.py +++ b/src/connectrpc/response_writer.py @@ -18,7 +18,7 @@ import asyncio -from gconnect.response import Response +from connectrpc.response import Response class ServerResponseWriter: diff --git a/src/gconnect/utils.py b/src/connectrpc/utils.py similarity index 98% rename from src/gconnect/utils.py rename to src/connectrpc/utils.py index 12a5b8a..7556f1d 100644 --- a/src/gconnect/utils.py +++ b/src/connectrpc/utils.py @@ -27,8 +27,8 @@ import anyio.to_thread import httpcore -from gconnect.code import Code -from gconnect.error import ConnectError +from connectrpc.code import Code +from connectrpc.error import ConnectError type AwaitableCallable[T] = typing.Callable[..., typing.Awaitable[T]] diff --git a/src/gconnect/version.py b/src/connectrpc/version.py similarity index 100% rename from src/gconnect/version.py rename to src/connectrpc/version.py diff --git a/tests/conftest.py b/tests/conftest.py index 4077bc2..274e96f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -34,9 +34,9 @@ from starlette.middleware import Middleware from yarl import URL -from gconnect.envelope import Envelope, EnvelopeFlags -from gconnect.middleware import ConnectMiddleware -from gconnect.options import HandlerOptions +from connectrpc.envelope import Envelope, EnvelopeFlags +from connectrpc.middleware import ConnectMiddleware +from connectrpc.options import HandlerOptions from tests.testdata.ping.v1.ping_pb2 import PingResponse from tests.testdata.ping.v1.v1connect.ping_connect import ( PingService_service_descriptor, diff --git a/tests/test_streaming_connect_client.py b/tests/test_streaming_connect_client.py index 2a6fbd2..fe8d221 100644 --- a/tests/test_streaming_connect_client.py +++ b/tests/test_streaming_connect_client.py @@ -24,15 +24,15 @@ import pytest -from gconnect.call_options import CallOptions -from gconnect.client import Client -from gconnect.client_interceptor import ClientInterceptor, StreamFunc -from gconnect.code import Code -from gconnect.connect import StreamRequest, StreamResponse, StreamType -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.envelope import Envelope, EnvelopeFlags -from gconnect.error import ConnectError -from gconnect.options import ClientOptions +from connectrpc.call_options import CallOptions +from connectrpc.client import Client +from connectrpc.client_interceptor import ClientInterceptor, StreamFunc +from connectrpc.code import Code +from connectrpc.connect import StreamRequest, StreamResponse, StreamType +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.envelope import Envelope, EnvelopeFlags +from connectrpc.error import ConnectError +from connectrpc.options import ClientOptions from tests.conftest import ASGIRequest, Receive, Scope, Send, ServerConfig from tests.testdata.ping.v1.ping_pb2 import PingRequest, PingResponse from tests.testdata.ping.v1.v1connect.ping_connect import PingServiceProcedures diff --git a/tests/test_streaming_connect_server.py b/tests/test_streaming_connect_server.py index 8aaa3f6..3274572 100644 --- a/tests/test_streaming_connect_server.py +++ b/tests/test_streaming_connect_server.py @@ -21,14 +21,14 @@ import pytest -from gconnect.code import Code -from gconnect.connect import StreamRequest, StreamResponse, StreamType -from gconnect.envelope import Envelope, EnvelopeFlags -from gconnect.error import ConnectError -from gconnect.handler_context import HandlerContext -from gconnect.handler_interceptor import HandlerInterceptor, StreamFunc -from gconnect.headers import Headers -from gconnect.options import HandlerOptions +from connectrpc.code import Code +from connectrpc.connect import StreamRequest, StreamResponse, StreamType +from connectrpc.envelope import Envelope, EnvelopeFlags +from connectrpc.error import ConnectError +from connectrpc.handler_context import HandlerContext +from connectrpc.handler_interceptor import HandlerInterceptor, StreamFunc +from connectrpc.headers import Headers +from connectrpc.options import HandlerOptions from tests.conftest import AsyncClient from tests.testdata.ping.v1.ping_pb2 import PingRequest, PingResponse from tests.testdata.ping.v1.v1connect.ping_connect import ( diff --git a/tests/test_unary_connect_client.py b/tests/test_unary_connect_client.py index 238da13..cb6ea41 100644 --- a/tests/test_unary_connect_client.py +++ b/tests/test_unary_connect_client.py @@ -23,15 +23,15 @@ import pytest -from gconnect.call_options import CallOptions -from gconnect.client import Client -from gconnect.client_interceptor import ClientInterceptor, UnaryFunc -from gconnect.code import Code -from gconnect.connect import StreamType, UnaryRequest, UnaryResponse -from gconnect.connection_pool import AsyncConnectionPool -from gconnect.error import ConnectError -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.options import ClientOptions +from connectrpc.call_options import CallOptions +from connectrpc.client import Client +from connectrpc.client_interceptor import ClientInterceptor, UnaryFunc +from connectrpc.code import Code +from connectrpc.connect import StreamType, UnaryRequest, UnaryResponse +from connectrpc.connection_pool import AsyncConnectionPool +from connectrpc.error import ConnectError +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.options import ClientOptions from tests.conftest import ASGIRequest, Receive, Scope, Send, ServerConfig from tests.testdata.ping.v1.ping_pb2 import PingRequest, PingResponse from tests.testdata.ping.v1.v1connect.ping_connect import PingServiceProcedures diff --git a/tests/test_unary_connect_server.py b/tests/test_unary_connect_server.py index bd78bf4..e223515 100644 --- a/tests/test_unary_connect_server.py +++ b/tests/test_unary_connect_server.py @@ -23,10 +23,10 @@ import pytest -from gconnect.connect import UnaryRequest, UnaryResponse -from gconnect.handler_context import HandlerContext -from gconnect.idempotency_level import IdempotencyLevel -from gconnect.options import HandlerOptions +from connectrpc.connect import UnaryRequest, UnaryResponse +from connectrpc.handler_context import HandlerContext +from connectrpc.idempotency_level import IdempotencyLevel +from connectrpc.options import HandlerOptions from tests.conftest import AsyncClient from tests.testdata.ping.v1.ping_pb2 import PingRequest, PingResponse from tests.testdata.ping.v1.v1connect.ping_connect import PingServiceHandler diff --git a/tests/testdata/ping/v1/v1connect/ping_connect.py b/tests/testdata/ping/v1/v1connect/ping_connect.py index f5e874b..5895ed9 100644 --- a/tests/testdata/ping/v1/v1connect/ping_connect.py +++ b/tests/testdata/ping/v1/v1connect/ping_connect.py @@ -5,10 +5,10 @@ from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor -from gconnect.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse -from gconnect.handler import ClientStreamHandler, Handler, ServerStreamHandler, UnaryHandler -from gconnect.handler_context import HandlerContext -from gconnect.options import HandlerOptions +from connectrpc.connect import StreamRequest, StreamResponse, UnaryRequest, UnaryResponse +from connectrpc.handler import ClientStreamHandler, Handler, ServerStreamHandler, UnaryHandler +from connectrpc.handler_context import HandlerContext +from connectrpc.options import HandlerOptions from tests.testdata.ping.v1 import ping_pb2 from tests.testdata.ping.v1.ping_pb2 import PingRequest, PingResponse diff --git a/uv.lock b/uv.lock index 98e046f..d605575 100644 --- a/uv.lock +++ b/uv.lock @@ -45,11 +45,11 @@ wheels = [ [[package]] name = "certifi" -version = "2025.7.14" +version = "2025.8.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b3/76/52c535bcebe74590f296d6c77c86dabf761c41980e1347a2422e4aa2ae41/certifi-2025.7.14.tar.gz", hash = "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995", size = 163981, upload-time = "2025-07-14T03:29:28.449Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/52/34c6cf5bb9285074dc3531c437b3919e825d976fde097a7a73f79e726d03/certifi-2025.7.14-py3-none-any.whl", hash = "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2", size = 162722, upload-time = "2025-07-14T03:29:26.863Z" }, + { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" }, ] [[package]] @@ -97,7 +97,7 @@ wheels = [ ] [[package]] -name = "gconnect" +name = "connectrpc" source = { editable = "." } dependencies = [ { name = "anyio" }, From 733f46ca45686619a146ea755d901a9ca590d174 Mon Sep 17 00:00:00 2001 From: tsubakiky Date: Sun, 3 Aug 2025 17:09:02 +0900 Subject: [PATCH 2/3] empty From d8f4438c47064175a2ecdd824f2ca7e0da25262b Mon Sep 17 00:00:00 2001 From: tsubakiky Date: Sun, 3 Aug 2025 17:19:03 +0900 Subject: [PATCH 3/3] .github: change os --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/conformance.yaml | 4 ++-- .../conformance/v1/conformancev1connect/service_connect.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b083c2d..a8de006 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ concurrency: jobs: lint: - runs-on: ubuntu-2404-4-cores + runs-on: ubuntu-latest steps: # https://github.com/actions/checkout @@ -42,7 +42,7 @@ jobs: uv run ruff format --check src test: - runs-on: ubuntu-2404-4-cores + runs-on: ubuntu-latest steps: # https://github.com/actions/checkout diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b53a11e..f054799 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ concurrency: jobs: server: - runs-on: ubuntu-2404-4-cores + runs-on: ubuntu-latest steps: # https://github.com/actions/checkout @@ -58,7 +58,7 @@ jobs: connectconformance --trace --vv --conf ./server_config.yaml --mode server --known-flaky @./server_known_flaky.yaml -- uv run python server_runner.py client: - runs-on: ubuntu-2404-4-cores + runs-on: ubuntu-latest steps: # https://github.com/actions/checkout diff --git a/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py b/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py index 22c14dc..9730f8c 100644 --- a/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py +++ b/conformance/gen/connectrpc/conformance/v1/conformancev1connect/service_connect.py @@ -1,4 +1,4 @@ -s# Generated by the protoc-gen-connect-python. DO NOT EDIT! +# Generated by the protoc-gen-connect-python. DO NOT EDIT! # source: connectrpc/conformance/v1/conformancev1connect/service.proto # Protobuf Python Version: (unknown) # protoc-gen-connect-python version: v0.0.0-20250710124620-c0c8871def6b+dirty