diff --git a/getter/core/base_client.py b/getter/core/base_client.py index 4afe0bb..3194a48 100644 --- a/getter/core/base_client.py +++ b/getter/core/base_client.py @@ -22,7 +22,6 @@ AccessTokenExpiredError, AccessTokenInvalidError, ) -from telethon.network.connection.tcpabridged import ConnectionTcpAbridged from telethon.sessions.abstract import Session from telethon.sessions.string import CURRENT_VERSION, StringSession from telethon.tl import functions as fun, types as typ @@ -62,8 +61,6 @@ def __init__( kwargs["api_id"] = api_id kwargs["api_hash"] = api_hash kwargs["base_logger"] = TelethonLogger - kwargs["connection"] = ConnectionTcpAbridged - kwargs["connection_retries"] = None kwargs["auto_reconnect"] = True super().__init__(session, **kwargs) self._event_builders = ReverseList() diff --git a/getter/core/patched/message.py b/getter/core/patched/message.py index 96f328b..8e70313 100644 --- a/getter/core/patched/message.py +++ b/getter/core/patched/message.py @@ -39,7 +39,7 @@ async def eor( ) -> typing.Optional[typing.Union[typ.Message, typing.Sequence[typ.messages.AffectedMessages]]]: if self is None: return - _ = args.get("reply_to", None) + _ = args.get("reply_to") reply_to = _ if _ else (self.reply_to_msg_id or (self if force_reply else None)) is_file = "file" in args and args.get("file", "") and not self.media for arg in ( @@ -198,7 +198,7 @@ async def sod( if self is None: return chat_id = chat_id or self.chat_id - _ = args.get("reply_to", None) + _ = args.get("reply_to") reply_to = _ if _ else (self.reply_to_msg_id or (self if force_reply else None)) is_file = "file" in args and args.get("file", "") and not self.media for arg in ( diff --git a/requirements-dev.txt b/requirements-dev.txt index 9af1ec6..74c2dee 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,8 @@ -black==23.1.0 +black==23.11.0 isort==5.12.0 -flake8==5.0.4 -flake8-builtins==2.1.0 -flake8-simplify==0.19.3 -flake8-comprehensions==3.10.1 -flake8-bugbear==23.3.12 +flake8==6.1.0 +flake8-builtins==2.2.0 +flake8-simplify==0.21.0 +flake8-comprehensions==3.14.0 +flake8-bugbear==23.12.2 flake8-pie==0.16.0 diff --git a/requirements.txt b/requirements.txt index 1efc2f5..203baec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ python-dotenv==1.0.0 https://github.com/kastaid/Telethon/archive/main.tar.gz cryptg==0.4.0 pytz==2022.7 -psutil==5.9.6 +psutil==5.9.7 heroku3==5.2.1 GitPython==3.1.40 psycopg2-binary==2.9.6 @@ -14,14 +14,14 @@ asyncache==0.3.1 aiofiles==23.2.1 aiocsv==1.2.5 async-timeout==4.0.3 -aiohttp[speedups]==3.9.0 +aiohttp[speedups]==3.9.1 Markdown==3.5.1 beautifulsoup4==4.12.2 -emoji==2.8.0 +emoji==2.9.0 validators==0.22.0 telegraph==2.2.0 requests==2.31.0 lottie==0.7.0 Pillow==10.1.0 CairoSVG==2.7.1 -uvloop==0.17.0 +uvloop==0.19.0 diff --git a/setup.cfg b/setup.cfg index 4d6df74..0e154fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,20 +27,38 @@ max-line-length = 120 select = E,F,W,B,C,I,T,S,A,N,P ignore = # https://flake8.pycqa.org/en/latest/user/error-codes.html - E201, # Whitespace after '(' - E202, # Whitespace before ')' - E203, # Whitespace before ':' - E266, # Too many leading '#' for block comment - E501, # Line too long (82 > 79 characters) - W503, # Line break occurred before a binary operator - C901, # Function is too complex - E302, # Expected 2 blank lines, found 0 - F403, # 'from module import *' used; unable to detect undefined names - SIM905, # Split string directly if only constants are used - PIE786, # precise-exception-handlers - PIE801, # prefer-simple-return - PIE803, # prefer-logging-interpolation - SIM105 # Use 'contextlib.suppress(BaseException)' + # Whitespace after '(' + E201, + # Whitespace before ')' + E202, + # Whitespace before ':' + E203, + # Too many leading '#' for block comment + E266, + # Line too long (82 > 79 characters) + E501, + # Line break occurred before a binary operator + W503, + # Function is too complex + C901, + # Expected 2 blank lines, found 0 + E302, + # 'from module import *' used; unable to detect undefined names + F403, + # Split string directly if only constants are used + SIM905, + # precise-exception-handlers + PIE786, + # prefer-simple-return + PIE801, + # prefer-logging-interpolation + PIE803, + # Use 'contextlib.suppress(BaseException)' + SIM105, + # Unnecessary dict comprehension - rewrite using dict() + C416, + # Star-arg unpacking after a keyword argument is strongly discouraged + B026 exclude = .git, __pycache__,