diff --git a/pdm.lock b/pdm.lock index 0fb471f..266f4b5 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = [] lock_version = "4.5.0" -content_hash = "sha256:c3d804e2ee78f86593649b5fcb4f5502cfa252c40c8d7eec1e9c0b66e107ad3f" +content_hash = "sha256:aa439e10a0a3fad97ca595a12f677383cb63deea46cfddd6d9f2d33383aca6e4" [[metadata.targets]] requires_python = ">=3.9" @@ -159,7 +159,7 @@ files = [ [[package]] name = "arclet-alconna" -version = "1.8.34" +version = "1.8.35" requires_python = ">=3.9" summary = "A High-performance, Generality, Humane Command Line Arguments Parser Library." dependencies = [ @@ -168,8 +168,8 @@ dependencies = [ "typing-extensions>=4.5.0", ] files = [ - {file = "arclet_alconna-1.8.34-py3-none-any.whl", hash = "sha256:8406ffbdfe4230c636360b42508e13b867ebb372a0c6a86cb165a6bfd58a2c1b"}, - {file = "arclet_alconna-1.8.34.tar.gz", hash = "sha256:93f7c5f9072aaf1bbf23bad6bacbd4251580694fd2850ff77981fff689933c4b"}, + {file = "arclet_alconna-1.8.35-py3-none-any.whl", hash = "sha256:95d8aaf079167b24e158a0c5125dc17c671da129969dcc5f8b79a9cc72b6389c"}, + {file = "arclet_alconna-1.8.35.tar.gz", hash = "sha256:0cdb7fbdd154110ed7fb79e2b281df6c5fc87861770301f1c0cf8af594ee95f3"}, ] [[package]] @@ -481,7 +481,7 @@ files = [ [[package]] name = "fastapi" -version = "0.115.5" +version = "0.115.6" requires_python = ">=3.8" summary = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" dependencies = [ @@ -490,8 +490,8 @@ dependencies = [ "typing-extensions>=4.8.0", ] files = [ - {file = "fastapi-0.115.5-py3-none-any.whl", hash = "sha256:596b95adbe1474da47049e802f9a65ab2ffa9c2b07e7efee70eb8a66c9f2f796"}, - {file = "fastapi-0.115.5.tar.gz", hash = "sha256:0e7a4d0dc0d01c68df21887cce0945e72d3c48b9f4f79dfe7a7d53aa08fbb289"}, + {file = "fastapi-0.115.6-py3-none-any.whl", hash = "sha256:e9240b29e36fa8f4bb7290316988e90c381e5092e0cbe84e7818cc3713bcf305"}, + {file = "fastapi-0.115.6.tar.gz", hash = "sha256:9ec46f7addc14ea472958a96aae5b5de65f39721a46aaf5705c480d9a8b76654"}, ] [[package]] @@ -811,8 +811,8 @@ files = [ [[package]] name = "loguru" -version = "0.7.2" -requires_python = ">=3.5" +version = "0.7.3" +requires_python = "<4.0,>=3.5" summary = "Python logging made (stupidly) simple" dependencies = [ "aiocontextvars>=0.2.0; python_version < \"3.7\"", @@ -820,8 +820,8 @@ dependencies = [ "win32-setctime>=1.0.0; sys_platform == \"win32\"", ] files = [ - {file = "loguru-0.7.2-py3-none-any.whl", hash = "sha256:003d71e3d3ed35f0f8984898359d65b79e5b21943f78af86aa5491210429b8eb"}, - {file = "loguru-0.7.2.tar.gz", hash = "sha256:e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac"}, + {file = "loguru-0.7.3-py3-none-any.whl", hash = "sha256:31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c"}, + {file = "loguru-0.7.3.tar.gz", hash = "sha256:19480589e77d47b8d85b2c827ad95d49bf31b0dcde16593892eb51dd18706eb6"}, ] [[package]] @@ -1148,7 +1148,7 @@ files = [ [[package]] name = "nonebot-adapter-mail" -version = "1.0.0a3" +version = "1.0.0a6" requires_python = "<4.0,>=3.9" summary = "Mail adapter for nonebot2" dependencies = [ @@ -1159,13 +1159,13 @@ dependencies = [ "pydantic[email]!=2.5.0,!=2.5.1,<3.0.0,>=1.10.0", ] files = [ - {file = "nonebot_adapter_mail-1.0.0a3-py3-none-any.whl", hash = "sha256:1e3d08150b65c8c4957d4e87665363b6bcbb5e3e84532fe98e0ba9c166593bc0"}, - {file = "nonebot_adapter_mail-1.0.0a3.tar.gz", hash = "sha256:5fcf839dbb2dba3bdc6f89fc41cd88fd38cdff766fd8317ceb4c0b1b1c87bad4"}, + {file = "nonebot_adapter_mail-1.0.0a6-py3-none-any.whl", hash = "sha256:9c3a33fc9b8dc184c30e3dc5a13a9fcfc5285d3a260dfc903cfbd4b3c8fc7388"}, + {file = "nonebot_adapter_mail-1.0.0a6.tar.gz", hash = "sha256:9c1faf23d39358973d27f81b4d063f25c3b5285c3ba8ffb0c326c89aa6e4c4cd"}, ] [[package]] name = "nonebot-adapter-minecraft" -version = "1.3.2" +version = "1.3.2.post1" requires_python = "<4.0,>=3.9" summary = "NoneBot2与MineCraft Server互通的适配器。" dependencies = [ @@ -1174,8 +1174,8 @@ dependencies = [ "pydantic!=2.5.0,!=2.5.1,<3.0.0,>=1.10.0", ] files = [ - {file = "nonebot_adapter_minecraft-1.3.2-py3-none-any.whl", hash = "sha256:31e2f34ea564dfd936c2e147cb14cd9b0b2ba0610b164f134353f77dc31e15af"}, - {file = "nonebot_adapter_minecraft-1.3.2.tar.gz", hash = "sha256:bed2f082224fc73cdc124236d82de36a53db7114f8bea66f2b6bb8f27946ffd2"}, + {file = "nonebot_adapter_minecraft-1.3.2.post1-py3-none-any.whl", hash = "sha256:e00c9ed0b40c2e913664dce67d62571528193daf3f2962f9ed3ea63c2ddd0f1b"}, + {file = "nonebot_adapter_minecraft-1.3.2.post1.tar.gz", hash = "sha256:f09b65cf76d5047121a12fc926f7029fc9d310bb9ae7e7615a457e3ca33af821"}, ] [[package]] @@ -1268,7 +1268,7 @@ files = [ [[package]] name = "nonebot-adapter-telegram" -version = "0.1.0b19" +version = "0.1.0b20" requires_python = "<4.0,>=3.9" summary = "Telegram Adapter for NoneBot2" dependencies = [ @@ -1277,8 +1277,8 @@ dependencies = [ "pydantic!=2.5.0,!=2.5.1,<3.0.0,>=2.0.3", ] files = [ - {file = "nonebot-adapter-telegram-0.1.0b19.tar.gz", hash = "sha256:b741027a1b4828d69d2191e880b6e7919a342071e9bac0dcf5db58b44884b33f"}, - {file = "nonebot_adapter_telegram-0.1.0b19-py3-none-any.whl", hash = "sha256:59d0f63a49487c9558c99709958c9392243c2fb27b8032b830afb63b775f0a54"}, + {file = "nonebot-adapter-telegram-0.1.0b20.tar.gz", hash = "sha256:fc17df61cbdb3162f29dbada1e5712b26f37c185da87602b613694bca32c9ada"}, + {file = "nonebot_adapter_telegram-0.1.0b20-py3-none-any.whl", hash = "sha256:a90acf29b8a9c8a16d4aaa93fb930debde4648d514f2050af945e973cd37a8d4"}, ] [[package]] @@ -1395,7 +1395,7 @@ files = [ [[package]] name = "nonebug" -version = "0.4.2" +version = "0.4.3" requires_python = "<4.0,>=3.9" summary = "nonebot2 test framework" dependencies = [ @@ -1406,8 +1406,8 @@ dependencies = [ "typing-extensions<5.0.0,>=4.0.0", ] files = [ - {file = "nonebug-0.4.2-py3-none-any.whl", hash = "sha256:83d9229ec899819e9f5786eabc0c27b9dd0cd5d6e2e7438f59923ab822d5c555"}, - {file = "nonebug-0.4.2.tar.gz", hash = "sha256:002dac00fed1fbff97574f3dffab2237fc41473b3bf3e73d2730ae34895bc137"}, + {file = "nonebug-0.4.3-py3-none-any.whl", hash = "sha256:eb9b2c8ab3d45459a4f00ebdaae90729e9e9628575c0685fca4c871dd4cfd425"}, + {file = "nonebug-0.4.3.tar.gz", hash = "sha256:e9592d2c7a42b76f4a336f98726cba92e1300f6bab155c8822e865919786f10c"}, ] [[package]] @@ -1550,7 +1550,7 @@ files = [ [[package]] name = "pydantic" -version = "2.10.1" +version = "2.10.3" requires_python = ">=3.8" summary = "Data validation using Python type hints" dependencies = [ @@ -1559,8 +1559,8 @@ dependencies = [ "typing-extensions>=4.12.2", ] files = [ - {file = "pydantic-2.10.1-py3-none-any.whl", hash = "sha256:a8d20db84de64cf4a7d59e899c2caf0fe9d660c7cfc482528e7020d7dd189a7e"}, - {file = "pydantic-2.10.1.tar.gz", hash = "sha256:a4daca2dc0aa429555e0656d6bf94873a7dc5f54ee42b1f5873d666fb3f35560"}, + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, ] [[package]] @@ -1663,17 +1663,17 @@ files = [ [[package]] name = "pydantic" -version = "2.10.1" +version = "2.10.3" extras = ["email"] requires_python = ">=3.8" summary = "Data validation using Python type hints" dependencies = [ "email-validator>=2.0.0", - "pydantic==2.10.1", + "pydantic==2.10.3", ] files = [ - {file = "pydantic-2.10.1-py3-none-any.whl", hash = "sha256:a8d20db84de64cf4a7d59e899c2caf0fe9d660c7cfc482528e7020d7dd189a7e"}, - {file = "pydantic-2.10.1.tar.gz", hash = "sha256:a4daca2dc0aa429555e0656d6bf94873a7dc5f54ee42b1f5873d666fb3f35560"}, + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, ] [[package]] @@ -1919,28 +1919,28 @@ files = [ [[package]] name = "ruff" -version = "0.8.0" +version = "0.8.2" requires_python = ">=3.7" summary = "An extremely fast Python linter and code formatter, written in Rust." files = [ - {file = "ruff-0.8.0-py3-none-linux_armv6l.whl", hash = "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea"}, - {file = "ruff-0.8.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b"}, - {file = "ruff-0.8.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426"}, - {file = "ruff-0.8.0-py3-none-win32.whl", hash = "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468"}, - {file = "ruff-0.8.0-py3-none-win_amd64.whl", hash = "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f"}, - {file = "ruff-0.8.0-py3-none-win_arm64.whl", hash = "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6"}, - {file = "ruff-0.8.0.tar.gz", hash = "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44"}, + {file = "ruff-0.8.2-py3-none-linux_armv6l.whl", hash = "sha256:c49ab4da37e7c457105aadfd2725e24305ff9bc908487a9bf8d548c6dad8bb3d"}, + {file = "ruff-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ec016beb69ac16be416c435828be702ee694c0d722505f9c1f35e1b9c0cc1bf5"}, + {file = "ruff-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f05cdf8d050b30e2ba55c9b09330b51f9f97d36d4673213679b965d25a785f3c"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60f578c11feb1d3d257b2fb043ddb47501ab4816e7e221fbb0077f0d5d4e7b6f"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbd5cf9b0ae8f30eebc7b360171bd50f59ab29d39f06a670b3e4501a36ba5897"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b402ddee3d777683de60ff76da801fa7e5e8a71038f57ee53e903afbcefdaa58"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:705832cd7d85605cb7858d8a13d75993c8f3ef1397b0831289109e953d833d29"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:32096b41aaf7a5cc095fa45b4167b890e4c8d3fd217603f3634c92a541de7248"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e769083da9439508833cfc7c23e351e1809e67f47c50248250ce1ac52c21fb93"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fe716592ae8a376c2673fdfc1f5c0c193a6d0411f90a496863c99cd9e2ae25d"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:81c148825277e737493242b44c5388a300584d73d5774defa9245aaef55448b0"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d261d7850c8367704874847d95febc698a950bf061c9475d4a8b7689adc4f7fa"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1ca4e3a87496dc07d2427b7dd7ffa88a1e597c28dad65ae6433ecb9f2e4f022f"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:729850feed82ef2440aa27946ab39c18cb4a8889c1128a6d589ffa028ddcfc22"}, + {file = "ruff-0.8.2-py3-none-win32.whl", hash = "sha256:ac42caaa0411d6a7d9594363294416e0e48fc1279e1b0e948391695db2b3d5b1"}, + {file = "ruff-0.8.2-py3-none-win_amd64.whl", hash = "sha256:2aae99ec70abf43372612a838d97bfe77d45146254568d94926e8ed5bbb409ea"}, + {file = "ruff-0.8.2-py3-none-win_arm64.whl", hash = "sha256:fb88e2a506b70cfbc2de6fae6681c4f944f7dd5f2fe87233a7233d888bad73e8"}, + {file = "ruff-0.8.2.tar.gz", hash = "sha256:b84f4f414dda8ac7f75075c1fa0b905ac0ff25361f42e6d5da681a465e0f78e5"}, ] [[package]] diff --git a/src/nonebot_plugin_alconna/extension.py b/src/nonebot_plugin_alconna/extension.py index a327918..da61a6a 100644 --- a/src/nonebot_plugin_alconna/extension.py +++ b/src/nonebot_plugin_alconna/extension.py @@ -314,7 +314,7 @@ def load_from_path(path: str) -> None: attrs = filter(None, (match.group("attr") or "__extension__").split(".")) ext = functools.reduce(getattr, attrs, module) if isinstance(ext, type) and issubclass(ext, Extension): - add_global_extension(ext) + add_global_extension(ext) # type: ignore elif isinstance(ext, Extension): add_global_extension(ext) else: diff --git a/src/nonebot_plugin_alconna/uniseg/adapters/mail/target.py b/src/nonebot_plugin_alconna/uniseg/adapters/mail/target.py deleted file mode 100644 index 192053c..0000000 --- a/src/nonebot_plugin_alconna/uniseg/adapters/mail/target.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import TYPE_CHECKING, Union - -from nonebot.adapters import Bot -from nonebot.adapters.mail.bot import Bot as MailBot - -from nonebot_plugin_alconna.uniseg.target import Target, TargetFetcher -from nonebot_plugin_alconna.uniseg.constraint import SupportScope, SupportAdapter - - -class MailTargetFetcher(TargetFetcher): - @classmethod - def get_adapter(cls) -> SupportAdapter: - return SupportAdapter.mail - - async def fetch(self, bot: Bot, target: Union[Target, None] = None): - if TYPE_CHECKING: - assert isinstance(bot, MailBot) - if target and not target.private: - return - for uid in await bot.get_unseen_uids(): - yield Target(uid, private=True, adapter=self.get_adapter(), self_id=bot.self_id, scope=SupportScope.mail) diff --git a/src/nonebot_plugin_alconna/uniseg/message.py b/src/nonebot_plugin_alconna/uniseg/message.py index 2224ead..f86c378 100644 --- a/src/nonebot_plugin_alconna/uniseg/message.py +++ b/src/nonebot_plugin_alconna/uniseg/message.py @@ -1076,7 +1076,7 @@ def replace( result_list: list[TS] = [] for seg in self: if isinstance(seg, Text): - result_list.append(seg.replace(old, new)) + result_list.append(seg.replace(old, new)) # type: ignore else: result_list.append(seg) return self.__class__(result_list) diff --git a/src/nonebot_plugin_alconna/uniseg/segment.py b/src/nonebot_plugin_alconna/uniseg/segment.py index 0127ab3..4b76e70 100644 --- a/src/nonebot_plugin_alconna/uniseg/segment.py +++ b/src/nonebot_plugin_alconna/uniseg/segment.py @@ -488,7 +488,7 @@ def split(self, pattern: Optional[str] = None): result.append(Text(part, _styles)) return result - def replace(self, old: str, new: Union[str, "Text"]): + def replace(self, old: str, new: Union[str, "Text"]) -> "Text": text = self.text index = 0 new_text = new if isinstance(new, str) else new.text