diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a37a523..fb423042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ### Fixed - 修复未通过标签判断是否是插件发布的问题 +- 不使用 asdict 避免遇到无法处理的类而报错 ## [3.1.1] - 2023-10-02 diff --git a/src/utils/plugin_test.py b/src/utils/plugin_test.py index 913cae05..a168daa5 100644 --- a/src/utils/plugin_test.py +++ b/src/utils/plugin_test.py @@ -30,7 +30,6 @@ RUNNER = """import json import os -from dataclasses import asdict from nonebot import init, load_plugin, require @@ -48,12 +47,14 @@ def default(self, obj): exit(1) else: if plugin.metadata: - metadata = asdict( - plugin.metadata, - dict_factory=lambda x: {{ - k: v for (k, v) in x if k not in ("config", "extra") - }}, - ) + metadata = {{ + "name": plugin.metadata.name, + "description": plugin.metadata.description, + "usage": plugin.metadata.usage, + "type": plugin.metadata.type, + "homepage": plugin.metadata.homepage, + "supported_adapters": plugin.metadata.supported_adapters, + }} with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf8") as f: f.write(f"METADATA<