From b57854f637755c8921a5a97f4e53a79e8ac4a4a3 Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Thu, 22 Aug 2024 09:48:18 +0100 Subject: [PATCH] move connections --- src/py/flwr/client/app.py | 8 ++++---- .../grpc_adapter}/__init__.py | 0 .../grpc_adapter}/connection.py | 0 .../{grpc_client => connection/grpc_bidi}/__init__.py | 0 .../{grpc_client => connection/grpc_bidi}/connection.py | 0 .../grpc_bidi}/connection_test.py | 0 .../grpc_rere}/__init__.py | 0 .../grpc_rere}/client_interceptor.py | 0 .../grpc_rere}/client_interceptor_test.py | 0 .../grpc_rere}/connection.py | 0 .../grpc_rere}/grpc_adapter.py | 0 .../grpc_rere}/grpc_adapter_test.py | 0 .../client/{rest_client => connection/rest}/__init__.py | 0 .../client/{rest_client => connection/rest}/connection.py | 0 14 files changed, 4 insertions(+), 4 deletions(-) rename src/py/flwr/client/{grpc_adapter_client => connection/grpc_adapter}/__init__.py (100%) rename src/py/flwr/client/{grpc_adapter_client => connection/grpc_adapter}/connection.py (100%) rename src/py/flwr/client/{grpc_client => connection/grpc_bidi}/__init__.py (100%) rename src/py/flwr/client/{grpc_client => connection/grpc_bidi}/connection.py (100%) rename src/py/flwr/client/{grpc_client => connection/grpc_bidi}/connection_test.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/__init__.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/client_interceptor.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/client_interceptor_test.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/connection.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/grpc_adapter.py (100%) rename src/py/flwr/client/{grpc_rere_client => connection/grpc_rere}/grpc_adapter_test.py (100%) rename src/py/flwr/client/{rest_client => connection/rest}/__init__.py (100%) rename src/py/flwr/client/{rest_client => connection/rest}/connection.py (100%) diff --git a/src/py/flwr/client/app.py b/src/py/flwr/client/app.py index 1f04efa99eeb..d7b2cde672fc 100644 --- a/src/py/flwr/client/app.py +++ b/src/py/flwr/client/app.py @@ -62,9 +62,9 @@ from flwr.server.superlink.linkstate.utils import generate_rand_int_from_bytes from .clientapp.clientappio_servicer import ClientAppInputs, ClientAppIoServicer -from .grpc_adapter_client.connection import grpc_adapter -from .grpc_client.connection import grpc_connection -from .grpc_rere_client.connection import grpc_request_response +from .connection.grpc_adapter.connection import grpc_adapter +from .connection.grpc_bidi.connection import grpc_connection +from .connection.grpc_rere.connection import grpc_request_response from .message_handler.message_handler import handle_control_message from .numpy_client import NumPyClient from .run_info_store import DeprecatedRunInfoStore @@ -786,7 +786,7 @@ def _init_connection(transport: Optional[str], server_address: str) -> tuple[ try: from requests.exceptions import ConnectionError as RequestsConnectionError - from .rest_client.connection import http_request_response + from .connection.rest.connection import http_request_response except ModuleNotFoundError: sys.exit(MISSING_EXTRA_REST) if server_address[:4] != "http": diff --git a/src/py/flwr/client/grpc_adapter_client/__init__.py b/src/py/flwr/client/connection/grpc_adapter/__init__.py similarity index 100% rename from src/py/flwr/client/grpc_adapter_client/__init__.py rename to src/py/flwr/client/connection/grpc_adapter/__init__.py diff --git a/src/py/flwr/client/grpc_adapter_client/connection.py b/src/py/flwr/client/connection/grpc_adapter/connection.py similarity index 100% rename from src/py/flwr/client/grpc_adapter_client/connection.py rename to src/py/flwr/client/connection/grpc_adapter/connection.py diff --git a/src/py/flwr/client/grpc_client/__init__.py b/src/py/flwr/client/connection/grpc_bidi/__init__.py similarity index 100% rename from src/py/flwr/client/grpc_client/__init__.py rename to src/py/flwr/client/connection/grpc_bidi/__init__.py diff --git a/src/py/flwr/client/grpc_client/connection.py b/src/py/flwr/client/connection/grpc_bidi/connection.py similarity index 100% rename from src/py/flwr/client/grpc_client/connection.py rename to src/py/flwr/client/connection/grpc_bidi/connection.py diff --git a/src/py/flwr/client/grpc_client/connection_test.py b/src/py/flwr/client/connection/grpc_bidi/connection_test.py similarity index 100% rename from src/py/flwr/client/grpc_client/connection_test.py rename to src/py/flwr/client/connection/grpc_bidi/connection_test.py diff --git a/src/py/flwr/client/grpc_rere_client/__init__.py b/src/py/flwr/client/connection/grpc_rere/__init__.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/__init__.py rename to src/py/flwr/client/connection/grpc_rere/__init__.py diff --git a/src/py/flwr/client/grpc_rere_client/client_interceptor.py b/src/py/flwr/client/connection/grpc_rere/client_interceptor.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/client_interceptor.py rename to src/py/flwr/client/connection/grpc_rere/client_interceptor.py diff --git a/src/py/flwr/client/grpc_rere_client/client_interceptor_test.py b/src/py/flwr/client/connection/grpc_rere/client_interceptor_test.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/client_interceptor_test.py rename to src/py/flwr/client/connection/grpc_rere/client_interceptor_test.py diff --git a/src/py/flwr/client/grpc_rere_client/connection.py b/src/py/flwr/client/connection/grpc_rere/connection.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/connection.py rename to src/py/flwr/client/connection/grpc_rere/connection.py diff --git a/src/py/flwr/client/grpc_rere_client/grpc_adapter.py b/src/py/flwr/client/connection/grpc_rere/grpc_adapter.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/grpc_adapter.py rename to src/py/flwr/client/connection/grpc_rere/grpc_adapter.py diff --git a/src/py/flwr/client/grpc_rere_client/grpc_adapter_test.py b/src/py/flwr/client/connection/grpc_rere/grpc_adapter_test.py similarity index 100% rename from src/py/flwr/client/grpc_rere_client/grpc_adapter_test.py rename to src/py/flwr/client/connection/grpc_rere/grpc_adapter_test.py diff --git a/src/py/flwr/client/rest_client/__init__.py b/src/py/flwr/client/connection/rest/__init__.py similarity index 100% rename from src/py/flwr/client/rest_client/__init__.py rename to src/py/flwr/client/connection/rest/__init__.py diff --git a/src/py/flwr/client/rest_client/connection.py b/src/py/flwr/client/connection/rest/connection.py similarity index 100% rename from src/py/flwr/client/rest_client/connection.py rename to src/py/flwr/client/connection/rest/connection.py