From d853073114c85b456e6b2fe1370ec8e25049b9a1 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 18 Nov 2023 18:56:33 -0300 Subject: [PATCH] update dependencies, formatter run --- litecord/blueprints/attachments.py | 1 - litecord/blueprints/channel/reactions.py | 1 - litecord/blueprints/channels.py | 1 - litecord/common/guilds.py | 1 - litecord/pubsub/lazy_guild.py | 1 - litecord/utils.py | 2 +- tox.ini | 14 +++++++------- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/litecord/blueprints/attachments.py b/litecord/blueprints/attachments.py index 9c60082..c5c4ca0 100644 --- a/litecord/blueprints/attachments.py +++ b/litecord/blueprints/attachments.py @@ -92,7 +92,6 @@ async def _resize(image, attach_id: int, ext: str, width: int, height: int) -> s "/attachments" "///", methods=["GET"] ) async def _get_attachment(channel_id: int, message_id: int, filename: str): - attach_id = await app.db.fetchval( """ SELECT id diff --git a/litecord/blueprints/channel/reactions.py b/litecord/blueprints/channel/reactions.py index b42c47f..c877c74 100644 --- a/litecord/blueprints/channel/reactions.py +++ b/litecord/blueprints/channel/reactions.py @@ -157,7 +157,6 @@ def emoji_sql( where_ext = f"AND emoji_id = {param}" main_emoji = emoji_id elif emoji_type == EmojiType.UNICODE: - # fun fact, emojis are length 1 in python? i'll use this to the # best of my ability, lol if len(emoji_name) != 1: diff --git a/litecord/blueprints/channels.py b/litecord/blueprints/channels.py index 7c62cf8..13dbc58 100644 --- a/litecord/blueprints/channels.py +++ b/litecord/blueprints/channels.py @@ -363,7 +363,6 @@ async def _process_overwrites(guild_id: int, channel_id: int, overwrites: list) user_ids: List[int] = [] for overwrite in overwrites: - # 0 for member overwrite, 1 for role overwrite target_type = 0 if overwrite["type"] == "member" else 1 target_role = None if target_type == 0 else overwrite["id"] diff --git a/litecord/common/guilds.py b/litecord/common/guilds.py index 476d9a1..7a93287 100644 --- a/litecord/common/guilds.py +++ b/litecord/common/guilds.py @@ -150,7 +150,6 @@ async def _specific_chan_create(channel_id, ctype, **kwargs): async def _subscribe_users_new_channel(guild_id: int, channel_id: int) -> None: - # for each state currently subscribed to guild, we check on the database # which states can also subscribe to the new channel at its creation. diff --git a/litecord/pubsub/lazy_guild.py b/litecord/pubsub/lazy_guild.py index 69f57a6..f0c15bd 100644 --- a/litecord/pubsub/lazy_guild.py +++ b/litecord/pubsub/lazy_guild.py @@ -552,7 +552,6 @@ class GuildMemberList: # NOTE: maybe use map()? for group, member_ids in self.list: - # do not send information on groups # that don't have anyone if not member_ids: diff --git a/litecord/utils.py b/litecord/utils.py index f153d85..032c68e 100644 --- a/litecord/utils.py +++ b/litecord/utils.py @@ -225,7 +225,7 @@ async def maybe_lazy_guild_dispatch( if isinstance(role, dict) and not role["hoist"] and not force: return - await (getattr(app.lazy_guild, event))(guild_id, role) + await getattr(app.lazy_guild, event)(guild_id, role) def extract_limit(request_, default: int = 50, max_val: int = 100): diff --git a/tox.ini b/tox.ini index fc195c8..1f32e58 100644 --- a/tox.ini +++ b/tox.ini @@ -5,13 +5,13 @@ isolated_build = true [testenv] ignore_errors = true deps = - pytest==7.1.2 - pytest-asyncio==0.19.0 - pytest-cov==3.0.0 - flake8==5.0.4 - black==22.6.0 - mypy==0.971 - pytest-instafail==0.4.2 + pytest==7.4.3 + pytest-asyncio==0.21.1 + pytest-cov==4.1.0 + flake8==6.1.0 + black==23.11.0 + mypy==1.7.0 + pytest-instafail==0.5.0 commands = python3 ./manage.py migrate black --check litecord run.py tests manage