diff --git a/bfxapi/_utils/logging.py b/bfxapi/_utils/logging.py index 593b99c..e19a120 100644 --- a/bfxapi/_utils/logging.py +++ b/bfxapi/_utils/logging.py @@ -1,7 +1,6 @@ import sys from copy import copy -# pylint: disable-next=wildcard-import,unused-wildcard-import from logging import * from typing import TYPE_CHECKING, Literal, Optional @@ -42,7 +41,6 @@ class _ColorFormatter(Formatter): return super().format(_record) - # pylint: disable-next=invalid-name def formatTime(self, record: LogRecord, datefmt: Optional[str] = None) -> str: return _GREEN + super().formatTime(record, datefmt) + _NC diff --git a/bfxapi/rest/endpoints/rest_auth_endpoints.py b/bfxapi/rest/endpoints/rest_auth_endpoints.py index 8afd13f..d8bcd1c 100644 --- a/bfxapi/rest/endpoints/rest_auth_endpoints.py +++ b/bfxapi/rest/endpoints/rest_auth_endpoints.py @@ -39,7 +39,6 @@ from ...types.serializers import _Notification from ..middleware import Middleware -# pylint: disable-next=too-many-public-methods class RestAuthEndpoints(Middleware): def get_user_info(self) -> UserInfo: return serializers.UserInfo.parse(*self._post("auth/r/info/user")) @@ -368,7 +367,6 @@ class RestAuthEndpoints(Middleware): for sub_data in self._post(endpoint) ] - # pylint: disable-next=too-many-arguments def submit_funding_offer( self, type: str, @@ -552,7 +550,6 @@ class RestAuthEndpoints(Middleware): *(self._post(f"auth/r/info/funding/{key}")[2]) ) - # pylint: disable-next=too-many-arguments def transfer_between_wallets( self, from_wallet: str, diff --git a/bfxapi/rest/endpoints/rest_merchant_endpoints.py b/bfxapi/rest/endpoints/rest_merchant_endpoints.py index 5752011..6f783d6 100644 --- a/bfxapi/rest/endpoints/rest_merchant_endpoints.py +++ b/bfxapi/rest/endpoints/rest_merchant_endpoints.py @@ -28,7 +28,6 @@ _CustomerInfo = TypedDict( class RestMerchantEndpoints(Middleware): - # pylint: disable-next=too-many-arguments def submit_invoice( self, amount: Union[str, float, Decimal], @@ -179,7 +178,6 @@ class RestMerchantEndpoints(Middleware): def get_merchant_settings(self, key: str) -> Any: return self._post("auth/r/ext/pay/settings/get", body={"key": key}) - # pylint: disable-next=dangerous-default-value def list_merchant_settings(self, keys: List[str] = []) -> Dict[str, Any]: return self._post("auth/r/ext/pay/settings/list", body={"keys": keys}) diff --git a/bfxapi/rest/endpoints/rest_public_endpoints.py b/bfxapi/rest/endpoints/rest_public_endpoints.py index c8b86b0..b8f5300 100644 --- a/bfxapi/rest/endpoints/rest_public_endpoints.py +++ b/bfxapi/rest/endpoints/rest_public_endpoints.py @@ -28,7 +28,6 @@ from ...types import ( from ..middleware import Middleware -# pylint: disable-next=too-many-public-methods class RestPublicEndpoints(Middleware): def conf(self, config: str) -> Any: return self._get(f"conf/{config}")[0] diff --git a/bfxapi/types/serializers.py b/bfxapi/types/serializers.py index 2b83b7c..d5d2dab 100644 --- a/bfxapi/types/serializers.py +++ b/bfxapi/types/serializers.py @@ -1,13 +1,11 @@ from . import dataclasses -# pylint: disable-next=unused-import from .labeler import ( _Serializer, generate_labeler_serializer, generate_recursive_serializer, ) -# pylint: disable-next=unused-import from .notification import _Notification __serializers__ = [ diff --git a/bfxapi/websocket/_client/bfx_websocket_client.py b/bfxapi/websocket/_client/bfx_websocket_client.py index ab10a94..a1a2cb2 100644 --- a/bfxapi/websocket/_client/bfx_websocket_client.py +++ b/bfxapi/websocket/_client/bfx_websocket_client.py @@ -67,7 +67,6 @@ class _Delay: self.__backoff_delay = _Delay.__BACKOFF_MIN -# pylint: disable-next=too-many-instance-attributes class BfxWebSocketClient(Connection): def __init__( self, @@ -101,7 +100,6 @@ class BfxWebSocketClient(Connection): type(exception), exception, exception.__traceback__ ) - # pylint: disable-next=logging-not-lazy self.__logger.critical(header + "\n" + str().join(stack_trace)[:-1]) @property @@ -111,7 +109,6 @@ class BfxWebSocketClient(Connection): def run(self) -> None: return asyncio.get_event_loop().run_until_complete(self.start()) - # pylint: disable-next=too-many-branches async def start(self) -> None: _delay = _Delay(backoff_factor=1.618) @@ -149,7 +146,6 @@ class BfxWebSocketClient(Connection): except asyncio.CancelledError: pass - # pylint: disable-next=consider-using-dict-items for bucket in self.__buckets: if task := self.__buckets[bucket]: self.__buckets[bucket] = None @@ -185,14 +181,12 @@ class BfxWebSocketClient(Connection): (isinstance(error, InvalidStatusCode) and error.status_code == 408) or isinstance(error, gaierror) ) and self.__reconnection: - # pylint: disable-next=logging-fstring-interpolation self.__logger.warning( "Reconnection attempt unsuccessful (no." f"{self.__reconnection['attempts']}): next attempt in " f"~{int(_delay.peek())}.0s." ) - # pylint: disable-next=logging-fstring-interpolation self.__logger.info( f"The client has been offline for " f"{datetime.now() - self.__reconnection['timestamp']}." @@ -214,7 +208,6 @@ class BfxWebSocketClient(Connection): async def __connect(self) -> None: async with websockets.client.connect(self._host) as websocket: if self.__reconnection: - # pylint: disable-next=logging-fstring-interpolation self.__logger.warning( "Reconnection attempt successful (no." f"{self.__reconnection['attempts']}): recovering " @@ -307,7 +300,6 @@ class BfxWebSocketClient(Connection): @Connection._require_websocket_connection async def unsubscribe(self, sub_id: str) -> None: - # pylint: disable-next=consider-using-dict-items for bucket in self.__buckets: if bucket.has(sub_id): if bucket.count == 1: diff --git a/bfxapi/websocket/_client/bfx_websocket_inputs.py b/bfxapi/websocket/_client/bfx_websocket_inputs.py index 14925ce..d618135 100644 --- a/bfxapi/websocket/_client/bfx_websocket_inputs.py +++ b/bfxapi/websocket/_client/bfx_websocket_inputs.py @@ -99,7 +99,6 @@ class BfxWebSocketInputs: "oc_multi", {"id": id, "cid": cid, "gid": gid, "all": all} ) - # pylint: disable-next=too-many-arguments async def submit_funding_offer( self, type: str, diff --git a/bfxapi/websocket/_connection.py b/bfxapi/websocket/_connection.py index 73c7dd9..10579d9 100644 --- a/bfxapi/websocket/_connection.py +++ b/bfxapi/websocket/_connection.py @@ -6,7 +6,6 @@ from datetime import datetime from functools import wraps from typing import Any, Awaitable, Callable, Dict, List, Optional, TypeVar, cast -# pylint: disable-next=wrong-import-order from typing_extensions import Concatenate, ParamSpec from websockets.client import WebSocketClientProtocol diff --git a/bfxapi/websocket/_handlers/public_channels_handler.py b/bfxapi/websocket/_handlers/public_channels_handler.py index 556c539..98da88c 100644 --- a/bfxapi/websocket/_handlers/public_channels_handler.py +++ b/bfxapi/websocket/_handlers/public_channels_handler.py @@ -39,7 +39,6 @@ class PublicChannelsHandler: elif subscription["channel"] == "status": self.__status_channel_handler(cast(Status, subscription), stream) - # pylint: disable-next=inconsistent-return-statements def __ticker_channel_handler(self, subscription: Ticker, stream: List[Any]): if subscription["symbol"].startswith("t"): return self.__event_emitter.emit( @@ -55,7 +54,6 @@ class PublicChannelsHandler: serializers.FundingCurrencyTicker.parse(*stream[0]), ) - # pylint: disable-next=inconsistent-return-statements def __trades_channel_handler(self, subscription: Trades, stream: List[Any]): if (event := stream[0]) and event in ["te", "tu", "fte", "ftu"]: events = { @@ -99,7 +97,6 @@ class PublicChannelsHandler: ], ) - # pylint: disable-next=inconsistent-return-statements def __book_channel_handler(self, subscription: Book, stream: List[Any]): if subscription["symbol"].startswith("t"): if all(isinstance(sub_stream, list) for sub_stream in stream[0]): @@ -135,7 +132,6 @@ class PublicChannelsHandler: serializers.FundingCurrencyBook.parse(*stream[0]), ) - # pylint: disable-next=inconsistent-return-statements def __raw_book_channel_handler(self, subscription: Book, stream: List[Any]): if subscription["symbol"].startswith("t"): if all(isinstance(sub_stream, list) for sub_stream in stream[0]): @@ -171,7 +167,6 @@ class PublicChannelsHandler: serializers.FundingCurrencyRawBook.parse(*stream[0]), ) - # pylint: disable-next=inconsistent-return-statements def __candles_channel_handler(self, subscription: Candles, stream: List[Any]): if all(isinstance(sub_stream, list) for sub_stream in stream[0]): return self.__event_emitter.emit( @@ -184,7 +179,6 @@ class PublicChannelsHandler: "candles_update", subscription, serializers.Candle.parse(*stream[0]) ) - # pylint: disable-next=inconsistent-return-statements def __status_channel_handler(self, subscription: Status, stream: List[Any]): if subscription["key"].startswith("deriv:"): return self.__event_emitter.emit( @@ -200,6 +194,5 @@ class PublicChannelsHandler: serializers.Liquidation.parse(*stream[0][0]), ) - # pylint: disable-next=inconsistent-return-statements def __checksum_handler(self, subscription: Book, value: int): return self.__event_emitter.emit("checksum", subscription, value & 0xFFFFFFFF) diff --git a/setup.py b/setup.py index 4abcb5e..b66d7a2 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ from distutils.core import setup _version = { } with open("bfxapi/_version.py", encoding="utf-8") as f: - #pylint: disable-next=exec-used exec(f.read(), _version) setup(