From 7451b13bbbda99f9c970f0f2730c4c4b904efbe8 Mon Sep 17 00:00:00 2001 From: uy/sun Date: Sat, 21 Oct 2023 12:27:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=92=E4=BB=B6=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=B6=E6=A3=80=E6=9F=A5=E5=85=83=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=98=AF=E5=90=A6=E4=B8=BA=20BaseModel=20?= =?UTF-8?q?=E5=AD=90=E7=B1=BB=20(#195)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ src/utils/plugin_test.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb423042..c091d941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ## [Unreleased] +### Added + +- 插件测试时检查元数据的配置是否为 BaseModel 子类 + ### Fixed - 修复未通过标签判断是否是插件发布的问题 diff --git a/src/utils/plugin_test.py b/src/utils/plugin_test.py index a168daa5..6cc0a1ee 100644 --- a/src/utils/plugin_test.py +++ b/src/utils/plugin_test.py @@ -32,6 +32,7 @@ import os from nonebot import init, load_plugin, require +from pydantic import BaseModel class SetEncoder(json.JSONEncoder): @@ -58,6 +59,14 @@ def default(self, obj): with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf8") as f: f.write(f"METADATA<