Skip to content

Commit f2e7c54

Browse files
authored
Pin grpcio versions in CI (#2776)
- Force `grpcio` version instead of always using `latest` - Bump `grpcio-tools` versions from 1.x0.0 to latest in their respective lines (e.g. ~=1.30.0 => ~=1.39.0) to avoid issues in early versions - Run grpc < 1.40 on py3.9 instead of py3.10 due to compilation issues (e.g. cython/cython#3876 + cython/cython#3921 + grpc/grpc#28398) * grpc < 1.40 requires `interceptors` to be a tuple * remove grpc-v1.29 from the test matrix due to `grpc.aio` being experimental
1 parent 21c4619 commit f2e7c54

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

sentry_sdk/integrations/grpc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def patched_aio_server(
128128
**kwargs: P.kwargs,
129129
) -> Server:
130130
server_interceptor = AsyncServerInterceptor()
131-
interceptors = [server_interceptor, *(interceptors or [])]
131+
interceptors = (server_interceptor, *(interceptors or []))
132132
return func(*args, interceptors=interceptors, **kwargs) # type: ignore
133133

134134
return patched_aio_server # type: ignore

tests/integrations/grpc/test_grpc_aio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ async def test_stream_unary(grpc_server):
219219

220220
class TestService(gRPCTestServiceServicer):
221221
class TestException(Exception):
222+
__test__ = False
223+
222224
def __init__(self):
223225
super().__init__("test")
224226

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ envlist =
124124
{py3.7,py3.11,py3.12}-graphene-latest
125125

126126
# gRPC
127-
{py3.7,py3.10}-grpc-v{1.21,1.30,1.40}
128-
{py3.7,py3.11}-grpc-v{1.50}
127+
{py3.7,py3.9}-grpc-v{1.39}
128+
{py3.7,py3.10}-grpc-v{1.49}
129+
{py3.7,py3.11}-grpc-v{1.59}
129130
{py3.8,py3.11,py3.12}-grpc-latest
130131

131132
# HTTPX
@@ -397,11 +398,10 @@ deps =
397398
grpc: mypy-protobuf
398399
grpc: types-protobuf
399400
grpc: pytest-asyncio<=0.21.1
400-
grpc-v1.21: grpcio-tools~=1.21.0
401-
grpc-v1.30: grpcio-tools~=1.30.0
402-
grpc-v1.40: grpcio-tools~=1.40.0
403-
grpc-v1.50: grpcio-tools~=1.50.0
404-
grpc-latest: grpcio-tools
401+
grpc-v1.39: grpcio~=1.39.0
402+
grpc-v1.49: grpcio~=1.49.1
403+
grpc-v1.59: grpcio~=1.59.0
404+
grpc-latest: grpcio
405405

406406
# HTTPX
407407
httpx-v0.16: pytest-httpx==0.10.0

0 commit comments

Comments
 (0)