diff --git a/archive/2.0.0a13/README.md b/archive/2.0.0a13.post1/README.md similarity index 100% rename from archive/2.0.0a13/README.md rename to archive/2.0.0a13.post1/README.md diff --git a/archive/2.0.0a13/advanced/README.md b/archive/2.0.0a13.post1/advanced/README.md similarity index 100% rename from archive/2.0.0a13/advanced/README.md rename to archive/2.0.0a13.post1/advanced/README.md diff --git a/archive/2.0.0a13/advanced/export-and-require.md b/archive/2.0.0a13.post1/advanced/export-and-require.md similarity index 100% rename from archive/2.0.0a13/advanced/export-and-require.md rename to archive/2.0.0a13.post1/advanced/export-and-require.md diff --git a/archive/2.0.0a13/advanced/overloaded-handlers.md b/archive/2.0.0a13.post1/advanced/overloaded-handlers.md similarity index 100% rename from archive/2.0.0a13/advanced/overloaded-handlers.md rename to archive/2.0.0a13.post1/advanced/overloaded-handlers.md diff --git a/archive/2.0.0a13/advanced/permission.md b/archive/2.0.0a13.post1/advanced/permission.md similarity index 100% rename from archive/2.0.0a13/advanced/permission.md rename to archive/2.0.0a13.post1/advanced/permission.md diff --git a/archive/2.0.0a13/advanced/publish-plugin.md b/archive/2.0.0a13.post1/advanced/publish-plugin.md similarity index 100% rename from archive/2.0.0a13/advanced/publish-plugin.md rename to archive/2.0.0a13.post1/advanced/publish-plugin.md diff --git a/archive/2.0.0a13/advanced/runtime-hook.md b/archive/2.0.0a13.post1/advanced/runtime-hook.md similarity index 100% rename from archive/2.0.0a13/advanced/runtime-hook.md rename to archive/2.0.0a13.post1/advanced/runtime-hook.md diff --git a/archive/2.0.0a13/advanced/scheduler.md b/archive/2.0.0a13.post1/advanced/scheduler.md similarity index 100% rename from archive/2.0.0a13/advanced/scheduler.md rename to archive/2.0.0a13.post1/advanced/scheduler.md diff --git a/archive/2.0.0a13/api/README.md b/archive/2.0.0a13.post1/api/README.md similarity index 100% rename from archive/2.0.0a13/api/README.md rename to archive/2.0.0a13.post1/api/README.md diff --git a/archive/2.0.0a13/api/adapters/README.md b/archive/2.0.0a13.post1/api/adapters/README.md similarity index 100% rename from archive/2.0.0a13/api/adapters/README.md rename to archive/2.0.0a13.post1/api/adapters/README.md diff --git a/archive/2.0.0a13/api/adapters/cqhttp.md b/archive/2.0.0a13.post1/api/adapters/cqhttp.md similarity index 100% rename from archive/2.0.0a13/api/adapters/cqhttp.md rename to archive/2.0.0a13.post1/api/adapters/cqhttp.md diff --git a/archive/2.0.0a13/api/adapters/ding.md b/archive/2.0.0a13.post1/api/adapters/ding.md similarity index 100% rename from archive/2.0.0a13/api/adapters/ding.md rename to archive/2.0.0a13.post1/api/adapters/ding.md diff --git a/archive/2.0.0a13/api/adapters/mirai.md b/archive/2.0.0a13.post1/api/adapters/mirai.md similarity index 100% rename from archive/2.0.0a13/api/adapters/mirai.md rename to archive/2.0.0a13.post1/api/adapters/mirai.md diff --git a/archive/2.0.0a13/api/config.md b/archive/2.0.0a13.post1/api/config.md similarity index 100% rename from archive/2.0.0a13/api/config.md rename to archive/2.0.0a13.post1/api/config.md diff --git a/archive/2.0.0a13/api/drivers/README.md b/archive/2.0.0a13.post1/api/drivers/README.md similarity index 100% rename from archive/2.0.0a13/api/drivers/README.md rename to archive/2.0.0a13.post1/api/drivers/README.md diff --git a/archive/2.0.0a13/api/drivers/fastapi.md b/archive/2.0.0a13.post1/api/drivers/fastapi.md similarity index 100% rename from archive/2.0.0a13/api/drivers/fastapi.md rename to archive/2.0.0a13.post1/api/drivers/fastapi.md diff --git a/archive/2.0.0a13/api/drivers/quart.md b/archive/2.0.0a13.post1/api/drivers/quart.md similarity index 100% rename from archive/2.0.0a13/api/drivers/quart.md rename to archive/2.0.0a13.post1/api/drivers/quart.md diff --git a/archive/2.0.0a13/api/exception.md b/archive/2.0.0a13.post1/api/exception.md similarity index 100% rename from archive/2.0.0a13/api/exception.md rename to archive/2.0.0a13.post1/api/exception.md diff --git a/archive/2.0.0a13/api/handler.md b/archive/2.0.0a13.post1/api/handler.md similarity index 100% rename from archive/2.0.0a13/api/handler.md rename to archive/2.0.0a13.post1/api/handler.md diff --git a/archive/2.0.0a13/api/log.md b/archive/2.0.0a13.post1/api/log.md similarity index 100% rename from archive/2.0.0a13/api/log.md rename to archive/2.0.0a13.post1/api/log.md diff --git a/archive/2.0.0a13/api/matcher.md b/archive/2.0.0a13.post1/api/matcher.md similarity index 100% rename from archive/2.0.0a13/api/matcher.md rename to archive/2.0.0a13.post1/api/matcher.md diff --git a/archive/2.0.0a13/api/message.md b/archive/2.0.0a13.post1/api/message.md similarity index 100% rename from archive/2.0.0a13/api/message.md rename to archive/2.0.0a13.post1/api/message.md diff --git a/archive/2.0.0a13/api/nonebot.md b/archive/2.0.0a13.post1/api/nonebot.md similarity index 100% rename from archive/2.0.0a13/api/nonebot.md rename to archive/2.0.0a13.post1/api/nonebot.md diff --git a/archive/2.0.0a13/api/permission.md b/archive/2.0.0a13.post1/api/permission.md similarity index 100% rename from archive/2.0.0a13/api/permission.md rename to archive/2.0.0a13.post1/api/permission.md diff --git a/archive/2.0.0a13/api/plugin.md b/archive/2.0.0a13.post1/api/plugin.md similarity index 100% rename from archive/2.0.0a13/api/plugin.md rename to archive/2.0.0a13.post1/api/plugin.md diff --git a/archive/2.0.0a13/api/rule.md b/archive/2.0.0a13.post1/api/rule.md similarity index 100% rename from archive/2.0.0a13/api/rule.md rename to archive/2.0.0a13.post1/api/rule.md diff --git a/archive/2.0.0a13/api/typing.md b/archive/2.0.0a13.post1/api/typing.md similarity index 100% rename from archive/2.0.0a13/api/typing.md rename to archive/2.0.0a13.post1/api/typing.md diff --git a/archive/2.0.0a13/api/utils.md b/archive/2.0.0a13.post1/api/utils.md similarity index 100% rename from archive/2.0.0a13/api/utils.md rename to archive/2.0.0a13.post1/api/utils.md diff --git a/archive/2.0.0a13/guide/README.md b/archive/2.0.0a13.post1/guide/README.md similarity index 100% rename from archive/2.0.0a13/guide/README.md rename to archive/2.0.0a13.post1/guide/README.md diff --git a/archive/2.0.0a13/guide/basic-configuration.md b/archive/2.0.0a13.post1/guide/basic-configuration.md similarity index 100% rename from archive/2.0.0a13/guide/basic-configuration.md rename to archive/2.0.0a13.post1/guide/basic-configuration.md diff --git a/archive/2.0.0a13/guide/cqhttp-guide.md b/archive/2.0.0a13.post1/guide/cqhttp-guide.md similarity index 100% rename from archive/2.0.0a13/guide/cqhttp-guide.md rename to archive/2.0.0a13.post1/guide/cqhttp-guide.md diff --git a/archive/2.0.0a13/guide/creating-a-handler.md b/archive/2.0.0a13.post1/guide/creating-a-handler.md similarity index 100% rename from archive/2.0.0a13/guide/creating-a-handler.md rename to archive/2.0.0a13.post1/guide/creating-a-handler.md diff --git a/archive/2.0.0a13/guide/creating-a-matcher.md b/archive/2.0.0a13.post1/guide/creating-a-matcher.md similarity index 100% rename from archive/2.0.0a13/guide/creating-a-matcher.md rename to archive/2.0.0a13.post1/guide/creating-a-matcher.md diff --git a/archive/2.0.0a13/guide/creating-a-plugin.md b/archive/2.0.0a13.post1/guide/creating-a-plugin.md similarity index 100% rename from archive/2.0.0a13/guide/creating-a-plugin.md rename to archive/2.0.0a13.post1/guide/creating-a-plugin.md diff --git a/archive/2.0.0a13/guide/creating-a-project.md b/archive/2.0.0a13.post1/guide/creating-a-project.md similarity index 100% rename from archive/2.0.0a13/guide/creating-a-project.md rename to archive/2.0.0a13.post1/guide/creating-a-project.md diff --git a/archive/2.0.0a13/guide/ding-guide.md b/archive/2.0.0a13.post1/guide/ding-guide.md similarity index 100% rename from archive/2.0.0a13/guide/ding-guide.md rename to archive/2.0.0a13.post1/guide/ding-guide.md diff --git a/archive/2.0.0a13/guide/end-or-start.md b/archive/2.0.0a13.post1/guide/end-or-start.md similarity index 100% rename from archive/2.0.0a13/guide/end-or-start.md rename to archive/2.0.0a13.post1/guide/end-or-start.md diff --git a/archive/2.0.0a13/guide/getting-started.md b/archive/2.0.0a13.post1/guide/getting-started.md similarity index 100% rename from archive/2.0.0a13/guide/getting-started.md rename to archive/2.0.0a13.post1/guide/getting-started.md diff --git a/archive/2.0.0a13/guide/images/Handle-Event.png b/archive/2.0.0a13.post1/guide/images/Handle-Event.png similarity index 100% rename from archive/2.0.0a13/guide/images/Handle-Event.png rename to archive/2.0.0a13.post1/guide/images/Handle-Event.png diff --git a/archive/2.0.0a13/guide/images/ding/jiaqian.png b/archive/2.0.0a13.post1/guide/images/ding/jiaqian.png similarity index 100% rename from archive/2.0.0a13/guide/images/ding/jiaqian.png rename to archive/2.0.0a13.post1/guide/images/ding/jiaqian.png diff --git a/archive/2.0.0a13/guide/images/ding/test_webhook.png b/archive/2.0.0a13.post1/guide/images/ding/test_webhook.png similarity index 100% rename from archive/2.0.0a13/guide/images/ding/test_webhook.png rename to archive/2.0.0a13.post1/guide/images/ding/test_webhook.png diff --git a/archive/2.0.0a13/guide/images/ding/webhook.png b/archive/2.0.0a13.post1/guide/images/ding/webhook.png similarity index 100% rename from archive/2.0.0a13/guide/images/ding/webhook.png rename to archive/2.0.0a13.post1/guide/images/ding/webhook.png diff --git a/archive/2.0.0a13/guide/installation.md b/archive/2.0.0a13.post1/guide/installation.md similarity index 100% rename from archive/2.0.0a13/guide/installation.md rename to archive/2.0.0a13.post1/guide/installation.md diff --git a/archive/2.0.0a13/guide/loading-a-plugin.md b/archive/2.0.0a13.post1/guide/loading-a-plugin.md similarity index 100% rename from archive/2.0.0a13/guide/loading-a-plugin.md rename to archive/2.0.0a13.post1/guide/loading-a-plugin.md diff --git a/archive/2.0.0a13/guide/mirai-guide.md b/archive/2.0.0a13.post1/guide/mirai-guide.md similarity index 100% rename from archive/2.0.0a13/guide/mirai-guide.md rename to archive/2.0.0a13.post1/guide/mirai-guide.md diff --git a/archive/2.0.0a13/sidebar.config.json b/archive/2.0.0a13.post1/sidebar.config.json similarity index 100% rename from archive/2.0.0a13/sidebar.config.json rename to archive/2.0.0a13.post1/sidebar.config.json diff --git a/docs/.vuepress/versions.json b/docs/.vuepress/versions.json index 81fb149d2044..2dcdf5fbabc4 100644 --- a/docs/.vuepress/versions.json +++ b/docs/.vuepress/versions.json @@ -1,5 +1,5 @@ [ - "2.0.0a13", + "2.0.0a13.post1", "2.0.0a10", "2.0.0a8.post2", "2.0.0a7" diff --git a/nonebot/adapters/_base.py b/nonebot/adapters/_base.py index f4290c3662c4..458b037f3648 100644 --- a/nonebot/adapters/_base.py +++ b/nonebot/adapters/_base.py @@ -9,9 +9,10 @@ import asyncio from copy import copy from functools import reduce, partial +from typing_extensions import Protocol from dataclasses import dataclass, field from typing import (Any, Set, Dict, Union, TypeVar, Mapping, Optional, Iterable, - Protocol, Awaitable, TYPE_CHECKING) + Awaitable, TYPE_CHECKING) from pydantic import BaseModel diff --git a/nonebot/plugin/__init__.py b/nonebot/plugin/__init__.py index f63bb97b1c10..9e5f682009d2 100644 --- a/nonebot/plugin/__init__.py +++ b/nonebot/plugin/__init__.py @@ -65,8 +65,9 @@ def matcher(self) -> Set[Type[Matcher]]: def _store_matcher(matcher: Type[Matcher]): - plugin_name = matcher.module.split(".", maxsplit=1)[0] - _plugin_matchers[plugin_name].add(matcher) + if matcher.module: + plugin_name = matcher.module.split(".", maxsplit=1)[0] + _plugin_matchers[plugin_name].add(matcher) def on(type: str = "", diff --git a/nonebot/plugin/manager.py b/nonebot/plugin/manager.py index fdbfe43b7279..c83a019ab0d2 100644 --- a/nonebot/plugin/manager.py +++ b/nonebot/plugin/manager.py @@ -179,7 +179,8 @@ def find_spec(self, fullname: str, path, target): newname = manager._rewrite_module_name(fullname) if newname: spec = PathFinder.find_spec( - newname, [*manager.search_path, *(path or [])], target) + newname, [*manager.search_path, *(path or sys.path)], + target) if spec: spec.loader = PluginLoader(manager, newname, spec.origin) diff --git a/pyproject.toml b/pyproject.toml index b3a8410b867c..6fa040fd5efc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot2" -version = "2.0.0-alpha.13" +version = "2.0.0a13.post1" description = "An asynchronous python bot framework." authors = ["yanyongyu "] license = "MIT"