Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: 添加插件元信息定义 #1046

Merged
merged 2 commits into from
Jun 20, 2022
Merged

Feature: 添加插件元信息定义 #1046

merged 2 commits into from
Jun 20, 2022

Conversation

yanyongyu
Copy link
Member

@yanyongyu yanyongyu commented Jun 17, 2022

related issue: #1015

example plugin:

from pydantic import BaseModel

from nonebot.plugin import PluginMetadata


class Config(BaseModel):
    custom: str = ""


__plugin_meta__ = PluginMetadata(
    name="测试插件",
    description="测试插件元信息",
    usage="无法使用",
    config=Config,
    extra={"author": "NoneBot"},
)

@yanyongyu yanyongyu added the enhancement New feature or request label Jun 17, 2022
@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #1046 (7f3a6bc) into master (ae21bfd) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
+ Coverage   77.96%   78.06%   +0.10%     
==========================================
  Files          42       42              
  Lines        3163     3178      +15     
==========================================
+ Hits         2466     2481      +15     
  Misses        697      697              
Flag Coverage Δ
unittests 78.06% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nonebot/plugin/__init__.py 96.72% <100.00%> (+0.05%) ⬆️
nonebot/plugin/manager.py 93.65% <100.00%> (+0.10%) ⬆️
nonebot/plugin/plugin.py 100.00% <100.00%> (ø)
nonebot/log.py 100.00% <0.00%> (ø)
nonebot/config.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae21bfd...7f3a6bc. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2022

🚀 Deployed on https://deploy-preview-1046--nonebot2.netlify.app

@github-actions github-actions bot temporarily deployed to pull request June 17, 2022 08:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request June 19, 2022 09:29 Inactive
@yanyongyu yanyongyu marked this pull request as ready for review June 19, 2022 09:36
Copy link
Member

@mnixry mnixry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那个插件加载钩子函数有考虑加一下吗👀

@yanyongyu
Copy link
Member Author

那个插件加载钩子函数有考虑加一下吗eyes

我觉得这个没有必要了,因为你要让插件加载的时候触发hook你首先得有hook,而hook又需要从插件里加载,这个会导致插件加载顺序出问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants