Skip to content

Commit

Permalink
fix(framework:skip) Bump gRPC-related dependencies (#4836)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Jan 18, 2025
1 parent 6f069f1 commit 69d73ae
Show file tree
Hide file tree
Showing 31 changed files with 1,045 additions and 218 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ python = "^3.9"
# Mandatory dependencies
numpy = ">=1.26.0,<3.0.0"
grpcio = "^1.69.0"
protobuf = "^4.25.2"
protobuf = "^5.29.3"
cryptography = "^43.0.1"
pycryptodome = "^3.18.0"
iterators = "^0.0.2"
Expand All @@ -92,7 +92,7 @@ rest = ["starlette", "uvicorn"]

[tool.poetry.group.dev.dependencies]
types-dataclasses = "==0.6.6"
types-protobuf = "==3.19.18"
types-protobuf = "==5.29.1.20241207"
types-requests = "==2.31.0.20240125"
types-setuptools = "==69.0.0.20240125"
clang-format = "==17.0.6"
Expand All @@ -107,7 +107,7 @@ parameterized = "==0.9.0"
pytest = "==7.4.4"
pytest-cov = "==4.1.0"
pytest-watcher = "==0.4.3"
grpcio-tools = "==1.60.0"
grpcio-tools = "==1.69.0"
mypy-protobuf = "==3.2.0"
jupyterlab = "==4.0.12"
rope = "==1.13.0"
Expand Down
16 changes: 13 additions & 3 deletions src/py/flwr/proto/clientappio_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 63 additions & 12 deletions src/py/flwr/proto/clientappio_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from flwr.proto import clientappio_pb2 as flwr_dot_proto_dot_clientappio__pb2

GRPC_GENERATED_VERSION = '1.69.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in flwr/proto/clientappio_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)


class ClientAppIoStub(object):
"""Missing associated documentation comment in .proto file."""
Expand All @@ -18,17 +38,17 @@ def __init__(self, channel):
'/flwr.proto.ClientAppIo/GetToken',
request_serializer=flwr_dot_proto_dot_clientappio__pb2.GetTokenRequest.SerializeToString,
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.GetTokenResponse.FromString,
)
_registered_method=True)
self.PullClientAppInputs = channel.unary_unary(
'/flwr.proto.ClientAppIo/PullClientAppInputs',
request_serializer=flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsRequest.SerializeToString,
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsResponse.FromString,
)
_registered_method=True)
self.PushClientAppOutputs = channel.unary_unary(
'/flwr.proto.ClientAppIo/PushClientAppOutputs',
request_serializer=flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsRequest.SerializeToString,
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsResponse.FromString,
)
_registered_method=True)


class ClientAppIoServicer(object):
Expand Down Expand Up @@ -77,6 +97,7 @@ def add_ClientAppIoServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'flwr.proto.ClientAppIo', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('flwr.proto.ClientAppIo', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand All @@ -94,11 +115,21 @@ def GetToken(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/GetToken',
return grpc.experimental.unary_unary(
request,
target,
'/flwr.proto.ClientAppIo/GetToken',
flwr_dot_proto_dot_clientappio__pb2.GetTokenRequest.SerializeToString,
flwr_dot_proto_dot_clientappio__pb2.GetTokenResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def PullClientAppInputs(request,
Expand All @@ -111,11 +142,21 @@ def PullClientAppInputs(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PullClientAppInputs',
return grpc.experimental.unary_unary(
request,
target,
'/flwr.proto.ClientAppIo/PullClientAppInputs',
flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsRequest.SerializeToString,
flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def PushClientAppOutputs(request,
Expand All @@ -128,8 +169,18 @@ def PushClientAppOutputs(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PushClientAppOutputs',
return grpc.experimental.unary_unary(
request,
target,
'/flwr.proto.ClientAppIo/PushClientAppOutputs',
flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsRequest.SerializeToString,
flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
16 changes: 13 additions & 3 deletions src/py/flwr/proto/error_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/py/flwr/proto/error_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings


GRPC_GENERATED_VERSION = '1.69.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in flwr/proto/error_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
20 changes: 15 additions & 5 deletions src/py/flwr/proto/exec_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 69d73ae

Please sign in to comment.