diff --git a/docs/.requirements.txt b/docs/.requirements.txt index 664ab62c..35f4f4ae 100644 --- a/docs/.requirements.txt +++ b/docs/.requirements.txt @@ -1,24 +1,21 @@ -click==8.1.7 ; python_version >= "3.8" and python_version < "4.0" -colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" -ghp-import==2.1.0 ; python_version >= "3.8" and python_version < "4.0" -importlib-metadata==8.5.0 ; python_version >= "3.8" and python_version < "3.10" -jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0" -markdown==3.7 ; python_version >= "3.8" and python_version < "4.0" -markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0" +click==8.0.3 ; python_version >= "3.8" and python_version < "4.0" +colorama==0.4.4 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" +ghp-import==2.0.1 ; python_version >= "3.8" and python_version < "4.0" +importlib-metadata==4.8.1 ; python_version >= "3.8" and python_version < "4.0" +jinja2==3.0.1 ; python_version >= "3.8" and python_version < "4.0" +markdown==3.3.4 ; python_version >= "3.8" and python_version < "4.0" +markupsafe==2.0.1 ; python_version >= "3.8" and python_version < "4.0" mergedeep==1.3.4 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-get-deps==0.2.0 ; python_version >= "3.8" and python_version < "4.0" mkdocs-markdownextradata-plugin==0.1.9 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-material-extensions==1.3.1 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-material==7.3.6 ; python_version >= "3.8" and python_version < "4.0" -mkdocs==1.6.1 ; python_version >= "3.8" and python_version < "4.0" +mkdocs-material-extensions==1.0.3 ; python_version >= "3.8" and python_version < "4.0" +mkdocs-material==7.2.6 ; python_version >= "3.8" and python_version < "4.0" +mkdocs==1.2.3 ; python_version >= "3.8" and python_version < "4.0" packaging==24.1 ; python_version >= "3.8" and python_version < "4.0" -pathspec==0.12.1 ; python_version >= "3.8" and python_version < "4.0" -platformdirs==4.3.6 ; python_version >= "3.8" and python_version < "4.0" -pygments==2.18.0 ; python_version >= "3.8" and python_version < "4.0" -pymdown-extensions==10.10.1 ; python_version >= "3.8" and python_version < "4.0" -python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" +pygments==2.10.0 ; python_version >= "3.8" and python_version < "4.0" +pymdown-extensions==8.2 ; python_version >= "3.8" and python_version < "4.0" +python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0" pyyaml-env-tag==0.1 ; python_version >= "3.8" and python_version < "4.0" pyyaml==5.4.1 ; python_version >= "3.8" and python_version < "4.0" six==1.16.0 ; python_version >= "3.8" and python_version < "4.0" -watchdog==4.0.2 ; python_version >= "3.8" and python_version < "4.0" -zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.10" +watchdog==2.1.5 ; python_version >= "3.8" and python_version < "4.0" +zipp==3.5.0 ; python_version >= "3.8" and python_version < "4.0" diff --git a/modmail/config.py b/modmail/config.py index 33d975bf..a5c397c7 100644 --- a/modmail/config.py +++ b/modmail/config.py @@ -202,9 +202,9 @@ class ConfigMetadata: # as a solution, I'm implementing a field which can provide a rich converter object, # in the style that discord.py uses. This will be called like discord py calls. discord_converter: discord.ext.commands.converter.Converter = attr.ib(default=None) - discord_converter_attribute: typing.Optional[ - types.FunctionType - ] = None # if we want an attribute off of the converted value + discord_converter_attribute: typing.Optional[types.FunctionType] = ( + None # if we want an attribute off of the converted value + ) # hidden values do not show up in the bot configuration menu hidden: bool = False diff --git a/modmail/dispatcher.py b/modmail/dispatcher.py index 929aedc8..8b146379 100644 --- a/modmail/dispatcher.py +++ b/modmail/dispatcher.py @@ -80,7 +80,7 @@ def activate(self, instance: object) -> None: if underlying_function not in self.pending_handlers: continue - for (event_name, priority) in self.pending_handlers[underlying_function]: + for event_name, priority in self.pending_handlers[underlying_function]: self._register_handler(event_name, priority, value) self.pending_handlers[underlying_function].clear() diff --git a/modmail/extensions/threads.py b/modmail/extensions/threads.py index 679a3f7a..f76157cd 100644 --- a/modmail/extensions/threads.py +++ b/modmail/extensions/threads.py @@ -136,9 +136,9 @@ def __init__(self, bot: "ModmailBot"): super().__init__(bot) # validation for this configuration variable is be defered to fully implementing # a new configuration system - self.relay_channel: Union[ - discord.TextChannel, discord.PartialMessageable - ] = self.bot.get_partial_messageable(self.bot.config.user.threads.relay_channel_id) + self.relay_channel: Union[discord.TextChannel, discord.PartialMessageable] = ( + self.bot.get_partial_messageable(self.bot.config.user.threads.relay_channel_id) + ) self.dms_to_users: Dict[int, int] = dict() # key: dm_channel.id, value: user.id diff --git a/modmail/plugins/local/README.md b/modmail/plugins/local/README.md index 817f6aba..d05cf5c0 100644 --- a/modmail/plugins/local/README.md +++ b/modmail/plugins/local/README.md @@ -7,6 +7,7 @@ Plugins should be like normal discord cogs, but should subclass `PluginCog` from ```py from modmail.plugin_helpers import PluginCog + class MyPlugin(PluginCog): pass ``` diff --git a/modmail/utils/pagination.py b/modmail/utils/pagination.py index b91b2914..40abc9fb 100644 --- a/modmail/utils/pagination.py +++ b/modmail/utils/pagination.py @@ -3,6 +3,7 @@ Originally adapated from: https://github.com/khk4912/EZPaginator/tree/84b5213741a78de266677b805c6f694ad94fedd6 """ + from __future__ import annotations import logging diff --git a/modmail/utils/responses.py b/modmail/utils/responses.py index 90a3c7a9..27d65df0 100644 --- a/modmail/utils/responses.py +++ b/modmail/utils/responses.py @@ -6,6 +6,7 @@ Note: these are to used for general success or general errors. Typically, the error handler will make a response if a command raises a discord.ext.commands.CommandError exception. """ + import logging import random import typing diff --git a/modmail/utils/threads/models.py b/modmail/utils/threads/models.py index 2fb57b37..d4063aac 100644 --- a/modmail/utils/threads/models.py +++ b/modmail/utils/threads/models.py @@ -73,9 +73,9 @@ def __init__( """ self.thread = thread self.recipient = recipient - self.log_message: Union[ - discord.Message, discord.PartialMessage - ] = log_message or self.thread.parent.get_partial_message(self.thread.id) + self.log_message: Union[discord.Message, discord.PartialMessage] = ( + log_message or self.thread.parent.get_partial_message(self.thread.id) + ) self.messages = MessageDict() self.close_after = self.thread.auto_archive_duration self.has_sent_initial_message = has_sent_initial_message diff --git a/requirements.txt b/requirements.txt index 664ab62c..abf58fe4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,24 +1,31 @@ -click==8.1.7 ; python_version >= "3.8" and python_version < "4.0" -colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" -ghp-import==2.1.0 ; python_version >= "3.8" and python_version < "4.0" -importlib-metadata==8.5.0 ; python_version >= "3.8" and python_version < "3.10" -jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0" -markdown==3.7 ; python_version >= "3.8" and python_version < "4.0" -markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0" -mergedeep==1.3.4 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-get-deps==0.2.0 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-markdownextradata-plugin==0.1.9 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-material-extensions==1.3.1 ; python_version >= "3.8" and python_version < "4.0" -mkdocs-material==7.3.6 ; python_version >= "3.8" and python_version < "4.0" -mkdocs==1.6.1 ; python_version >= "3.8" and python_version < "4.0" -packaging==24.1 ; python_version >= "3.8" and python_version < "4.0" -pathspec==0.12.1 ; python_version >= "3.8" and python_version < "4.0" -platformdirs==4.3.6 ; python_version >= "3.8" and python_version < "4.0" -pygments==2.18.0 ; python_version >= "3.8" and python_version < "4.0" -pymdown-extensions==10.10.1 ; python_version >= "3.8" and python_version < "4.0" -python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" -pyyaml-env-tag==0.1 ; python_version >= "3.8" and python_version < "4.0" +aiodns==3.0.0 ; python_version >= "3.8" and python_version < "4.0" +aiohttp==3.7.4.post0 ; python_version >= "3.8" and python_version < "4.0" +aiohttp[speedups]==3.7.4.post0 ; python_version >= "3.8" and python_version < "4.0" +arrow==1.1.1 ; python_version >= "3.8" and python_version < "4.0" +async-timeout==3.0.1 ; python_version >= "3.8" and python_version < "4.0" +atoml==1.0.3 ; python_version >= "3.8" and python_version < "4.0" +attrs==21.2.0 ; python_version >= "3.8" and python_version < "4.0" +brotlipy==0.7.0 ; python_version >= "3.8" and python_version < "4.0" +cchardet==2.1.7 ; python_version >= "3.8" and python_version < "4.0" +cffi==1.15.0 ; python_version >= "3.8" and python_version < "4.0" +chardet==4.0.0 ; python_version >= "3.8" and python_version < "4.0" +colorama==0.4.4 ; python_version >= "3.8" and python_version < "4.0" +coloredlogs==15.0.1 ; python_version >= "3.8" and python_version < "4.0" +desert==2020.11.18 ; python_version >= "3.8" and python_version < "4.0" +discord-py @ https://github.com/Rapptz/discord.py/archive/45d498c1b76deaf3b394d17ccf56112fa691d160.zip ; python_version >= "3.8" and python_version < "4.0" +humanfriendly==10.0 ; python_version >= "3.8" and python_version < "4.0" +idna==3.2 ; python_version >= "3.8" and python_version < "4.0" +marshmallow-enum==1.5.1 ; python_version >= "3.8" and python_version < "4.0" +marshmallow==3.13.0 ; python_version >= "3.8" and python_version < "4.0" +multidict==5.2.0 ; python_version >= "3.8" and python_version < "4.0" +mypy-extensions==0.4.3 ; python_version >= "3.8" and python_version < "4.0" +pycares==4.1.2 ; python_version >= "3.8" and python_version < "4.0" +pycparser==2.20 ; python_version >= "3.8" and python_version < "4.0" +pyreadline3==3.3 ; sys_platform == "win32" and python_version >= "3.8" and python_version < "4.0" +python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0" +python-dotenv==0.19.2 ; python_version >= "3.8" and python_version < "4.0" pyyaml==5.4.1 ; python_version >= "3.8" and python_version < "4.0" six==1.16.0 ; python_version >= "3.8" and python_version < "4.0" -watchdog==4.0.2 ; python_version >= "3.8" and python_version < "4.0" -zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.10" +typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "4.0" +typing-inspect==0.7.1 ; python_version >= "3.8" and python_version < "4.0" +yarl==1.7.2 ; python_version >= "3.8" and python_version < "4.0" diff --git a/scripts/export_new_config_to_default_config.py b/scripts/export_new_config_to_default_config.py index 203d8cf6..fa3e8bcd 100644 --- a/scripts/export_new_config_to_default_config.py +++ b/scripts/export_new_config_to_default_config.py @@ -3,6 +3,7 @@ This is intended to be used as a local pre-commit hook, which runs if the modmail/config.py file is changed. """ + import difflib import json import os diff --git a/tests/mocks.py b/tests/mocks.py index fed6b01d..a44bff51 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -31,6 +31,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ + from __future__ import annotations import asyncio