Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(framework) Bump mypy-protobuf dependency to 3.6.0 #4837

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pytest = "==7.4.4"
pytest-cov = "==4.1.0"
pytest-watcher = "==0.4.3"
grpcio-tools = "==1.69.0"
mypy-protobuf = "==3.2.0"
mypy-protobuf = "==3.6.0"
jupyterlab = "==4.0.12"
rope = "==1.13.0"
semver = "==3.0.2"
Expand Down
122 changes: 85 additions & 37 deletions src/py/flwr/proto/clientappio_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,80 +1,118 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright 2024 Flower Labs GmbH. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
"""

import builtins
import flwr.proto.fab_pb2
import flwr.proto.message_pb2
import flwr.proto.run_pb2
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import sys
import typing
import typing_extensions

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _ClientAppOutputCode:
ValueType = typing.NewType('ValueType', builtins.int)
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _ClientAppOutputCodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ClientAppOutputCode.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
SUCCESS: _ClientAppOutputCode.ValueType # 0
DEADLINE_EXCEEDED: _ClientAppOutputCode.ValueType # 1
UNKNOWN_ERROR: _ClientAppOutputCode.ValueType # 2
class ClientAppOutputCode(_ClientAppOutputCode, metaclass=_ClientAppOutputCodeEnumTypeWrapper):
pass

class ClientAppOutputCode(_ClientAppOutputCode, metaclass=_ClientAppOutputCodeEnumTypeWrapper): ...

SUCCESS: ClientAppOutputCode.ValueType # 0
DEADLINE_EXCEEDED: ClientAppOutputCode.ValueType # 1
UNKNOWN_ERROR: ClientAppOutputCode.ValueType # 2
global___ClientAppOutputCode = ClientAppOutputCode


@typing.final
class ClientAppOutputStatus(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

CODE_FIELD_NUMBER: builtins.int
MESSAGE_FIELD_NUMBER: builtins.int
code: global___ClientAppOutputCode.ValueType
message: typing.Text
def __init__(self,
message: builtins.str
def __init__(
self,
*,
code: global___ClientAppOutputCode.ValueType = ...,
message: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["code",b"code","message",b"message"]) -> None: ...
message: builtins.str = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["code", b"code", "message", b"message"]) -> None: ...

global___ClientAppOutputStatus = ClientAppOutputStatus

@typing.final
class GetTokenRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
def __init__(self,
) -> None: ...

def __init__(
self,
) -> None: ...

global___GetTokenRequest = GetTokenRequest

@typing.final
class GetTokenResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

TOKEN_FIELD_NUMBER: builtins.int
token: builtins.int
def __init__(self,
def __init__(
self,
*,
token: builtins.int = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
) -> None: ...
def ClearField(self, field_name: typing.Literal["token", b"token"]) -> None: ...

global___GetTokenResponse = GetTokenResponse

@typing.final
class PullClientAppInputsRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

TOKEN_FIELD_NUMBER: builtins.int
token: builtins.int
def __init__(self,
def __init__(
self,
*,
token: builtins.int = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
) -> None: ...
def ClearField(self, field_name: typing.Literal["token", b"token"]) -> None: ...

global___PullClientAppInputsRequest = PullClientAppInputsRequest

@typing.final
class PullClientAppInputsResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

MESSAGE_FIELD_NUMBER: builtins.int
CONTEXT_FIELD_NUMBER: builtins.int
RUN_FIELD_NUMBER: builtins.int
Expand All @@ -87,19 +125,23 @@ class PullClientAppInputsResponse(google.protobuf.message.Message):
def run(self) -> flwr.proto.run_pb2.Run: ...
@property
def fab(self) -> flwr.proto.fab_pb2.Fab: ...
def __init__(self,
def __init__(
self,
*,
message: typing.Optional[flwr.proto.message_pb2.Message] = ...,
context: typing.Optional[flwr.proto.message_pb2.Context] = ...,
run: typing.Optional[flwr.proto.run_pb2.Run] = ...,
fab: typing.Optional[flwr.proto.fab_pb2.Fab] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","message",b"message","run",b"run"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","message",b"message","run",b"run"]) -> None: ...
message: flwr.proto.message_pb2.Message | None = ...,
context: flwr.proto.message_pb2.Context | None = ...,
run: flwr.proto.run_pb2.Run | None = ...,
fab: flwr.proto.fab_pb2.Fab | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["context", b"context", "fab", b"fab", "message", b"message", "run", b"run"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["context", b"context", "fab", b"fab", "message", b"message", "run", b"run"]) -> None: ...

global___PullClientAppInputsResponse = PullClientAppInputsResponse

@typing.final
class PushClientAppOutputsRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

TOKEN_FIELD_NUMBER: builtins.int
MESSAGE_FIELD_NUMBER: builtins.int
CONTEXT_FIELD_NUMBER: builtins.int
Expand All @@ -108,25 +150,31 @@ class PushClientAppOutputsRequest(google.protobuf.message.Message):
def message(self) -> flwr.proto.message_pb2.Message: ...
@property
def context(self) -> flwr.proto.message_pb2.Context: ...
def __init__(self,
def __init__(
self,
*,
token: builtins.int = ...,
message: typing.Optional[flwr.proto.message_pb2.Message] = ...,
context: typing.Optional[flwr.proto.message_pb2.Context] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["context",b"context","message",b"message"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","message",b"message","token",b"token"]) -> None: ...
message: flwr.proto.message_pb2.Message | None = ...,
context: flwr.proto.message_pb2.Context | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["context", b"context", "message", b"message"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["context", b"context", "message", b"message", "token", b"token"]) -> None: ...

global___PushClientAppOutputsRequest = PushClientAppOutputsRequest

@typing.final
class PushClientAppOutputsResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

STATUS_FIELD_NUMBER: builtins.int
@property
def status(self) -> global___ClientAppOutputStatus: ...
def __init__(self,
def __init__(
self,
*,
status: typing.Optional[global___ClientAppOutputStatus] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["status",b"status"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["status",b"status"]) -> None: ...
status: global___ClientAppOutputStatus | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["status", b"status"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["status", b"status"]) -> None: ...

global___PushClientAppOutputsResponse = PushClientAppOutputsResponse
81 changes: 63 additions & 18 deletions src/py/flwr/proto/clientappio_pb2_grpc.pyi
Original file line number Diff line number Diff line change
@@ -1,53 +1,98 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright 2024 Flower Labs GmbH. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
"""

import abc
import collections.abc
import flwr.proto.clientappio_pb2
import grpc
import grpc.aio
import typing

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
...

class ClientAppIoStub:
def __init__(self, channel: grpc.Channel) -> None: ...
def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
GetToken: grpc.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.GetTokenRequest,
flwr.proto.clientappio_pb2.GetTokenResponse]
flwr.proto.clientappio_pb2.GetTokenResponse,
]
"""Get token"""

PullClientAppInputs: grpc.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.PullClientAppInputsRequest,
flwr.proto.clientappio_pb2.PullClientAppInputsResponse]
flwr.proto.clientappio_pb2.PullClientAppInputsResponse,
]
"""Get Message, Context, and Run"""

PushClientAppOutputs: grpc.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.PushClientAppOutputsRequest,
flwr.proto.clientappio_pb2.PushClientAppOutputsResponse]
flwr.proto.clientappio_pb2.PushClientAppOutputsResponse,
]
"""Send updated Message and Context"""

class ClientAppIoAsyncStub:
GetToken: grpc.aio.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.GetTokenRequest,
flwr.proto.clientappio_pb2.GetTokenResponse,
]
"""Get token"""

PullClientAppInputs: grpc.aio.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.PullClientAppInputsRequest,
flwr.proto.clientappio_pb2.PullClientAppInputsResponse,
]
"""Get Message, Context, and Run"""

PushClientAppOutputs: grpc.aio.UnaryUnaryMultiCallable[
flwr.proto.clientappio_pb2.PushClientAppOutputsRequest,
flwr.proto.clientappio_pb2.PushClientAppOutputsResponse,
]
"""Send updated Message and Context"""

class ClientAppIoServicer(metaclass=abc.ABCMeta):
@abc.abstractmethod
def GetToken(self,
def GetToken(
self,
request: flwr.proto.clientappio_pb2.GetTokenRequest,
context: grpc.ServicerContext,
) -> flwr.proto.clientappio_pb2.GetTokenResponse:
context: _ServicerContext,
) -> typing.Union[flwr.proto.clientappio_pb2.GetTokenResponse, collections.abc.Awaitable[flwr.proto.clientappio_pb2.GetTokenResponse]]:
"""Get token"""
pass

@abc.abstractmethod
def PullClientAppInputs(self,
def PullClientAppInputs(
self,
request: flwr.proto.clientappio_pb2.PullClientAppInputsRequest,
context: grpc.ServicerContext,
) -> flwr.proto.clientappio_pb2.PullClientAppInputsResponse:
context: _ServicerContext,
) -> typing.Union[flwr.proto.clientappio_pb2.PullClientAppInputsResponse, collections.abc.Awaitable[flwr.proto.clientappio_pb2.PullClientAppInputsResponse]]:
"""Get Message, Context, and Run"""
pass

@abc.abstractmethod
def PushClientAppOutputs(self,
def PushClientAppOutputs(
self,
request: flwr.proto.clientappio_pb2.PushClientAppOutputsRequest,
context: grpc.ServicerContext,
) -> flwr.proto.clientappio_pb2.PushClientAppOutputsResponse:
context: _ServicerContext,
) -> typing.Union[flwr.proto.clientappio_pb2.PushClientAppOutputsResponse, collections.abc.Awaitable[flwr.proto.clientappio_pb2.PushClientAppOutputsResponse]]:
"""Send updated Message and Context"""
pass


def add_ClientAppIoServicer_to_server(servicer: ClientAppIoServicer, server: grpc.Server) -> None: ...
def add_ClientAppIoServicer_to_server(servicer: ClientAppIoServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
30 changes: 24 additions & 6 deletions src/py/flwr/proto/error_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright 2024 Flower Labs GmbH. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
"""

import builtins
import google.protobuf.descriptor
import google.protobuf.message
import typing
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class Error(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

CODE_FIELD_NUMBER: builtins.int
REASON_FIELD_NUMBER: builtins.int
code: builtins.int
reason: typing.Text
def __init__(self,
reason: builtins.str
def __init__(
self,
*,
code: builtins.int = ...,
reason: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["code",b"code","reason",b"reason"]) -> None: ...
reason: builtins.str = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["code", b"code", "reason", b"reason"]) -> None: ...

global___Error = Error
Loading
Loading