From 206ebe79415867d25f4fde1a80bf36feb482a5f6 Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Sun, 1 Oct 2023 23:01:17 +0200 Subject: [PATCH] Remove circular import from file bfx_websocket_client.py. --- bfxapi/client.py | 6 +++--- bfxapi/websocket/_client/bfx_websocket_client.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bfxapi/client.py b/bfxapi/client.py index dd9127c..3d7f3e6 100644 --- a/bfxapi/client.py +++ b/bfxapi/client.py @@ -1,5 +1,5 @@ from typing import \ - TYPE_CHECKING, TypedDict, List, Literal, Optional + TYPE_CHECKING, List, Literal, Optional from bfxapi._utils.logging import ColorLogger @@ -10,8 +10,8 @@ from bfxapi.websocket import BfxWebSocketClient from bfxapi.urls import REST_HOST, WSS_HOST if TYPE_CHECKING: - _Credentials = TypedDict("_Credentials", \ - { "api_key": str, "api_secret": str, "filters": Optional[List[str]] }) + from bfxapi.websocket._client.bfx_websocket_client import \ + _Credentials class Client: def __init__( diff --git a/bfxapi/websocket/_client/bfx_websocket_client.py b/bfxapi/websocket/_client/bfx_websocket_client.py index 8b6aada..249ba59 100644 --- a/bfxapi/websocket/_client/bfx_websocket_client.py +++ b/bfxapi/websocket/_client/bfx_websocket_client.py @@ -31,15 +31,16 @@ from bfxapi.websocket.exceptions import \ OutdatedClientVersion, \ ZeroConnectionsError -from .bfx_websocket_bucket import BfxWebSocketBucket +from bfxapi.websocket._client.bfx_websocket_bucket import BfxWebSocketBucket -from .bfx_websocket_inputs import BfxWebSocketInputs +from bfxapi.websocket._client.bfx_websocket_inputs import BfxWebSocketInputs if TYPE_CHECKING: - from bfxapi.client import _Credentials - from asyncio import Task + _Credentials = TypedDict("_Credentials", \ + { "api_key": str, "api_secret": str, "filters": Optional[List[str]] }) + _Reconnection = TypedDict("_Reconnection", { "attempts": int, "reason": str, "timestamp": datetime })