Plugin registry compares plugins by equality, not identity
维护者通常 1 天内回复
@00200200 已经在做这个了。
开始于 2026年10月11日。
评估
调研方向
从插件管理器中的register()、get_name()和is_registered()开始,它们使用==或in对_name2plugin的值进行插件比较,并将其与已经使用is的get_hookcallers()进行比较。使用issue中两个dataclass实例的示例进行复现,然后将比较改为同一性比较。完成标准是:两个相等但不同的插件对象可以以不同名称注册,并且现有测试套件仍然通过。
由索引模型根据 Issue 内容生成。
描述
🤖 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
register() (plugin in self._name2plugin.values()), get_name() and is_registered() use ==, while get_hookcallers() uses is. Two distinct plugins that compare equal are treated as one:
@dataclass
class P:
@hookimpl
def myhook(self): ...
pm.register(P(), "one")
pm.register(P(), "two") # ValueError: Plugin already registered under a different name
Proposal: use identity everywhere. Small behavior change for plugins with a custom __eq__.
Found while working on #759.
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 187
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 24
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pytest-dev/pluggy 的其他 Issue
-
Hook tracing crashes with specced Mock arguments and results可能已有人在做 @RonnyPfannschmidt 于 1 天前认领。 未关闭
难度 2/5 半天 新手友好度 25/100
pytest-dev/pluggy#792 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
deprecate passing None as a plugin instance可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 30/100
pytest-dev/pluggy#790 · 1 条评论 ·
维护者通常 1 天内回复
-
Defaulted positional-only hook parameters are forwarded as keywords可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 1-2 天 新手友好度 45/100
pytest-dev/pluggy#774 · 3 条评论 ·
维护者通常 1 天内回复
-
unregister() argument validation relies on assert可能已有人在做 @ekanshul 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 42/100
pytest-dev/pluggy#762 ·
维护者通常 1 天内回复
-
Failures during add_hookspecs / historic replay leave partial state可能已有人在做 @starx710 于 4 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 50/100
pytest-dev/pluggy#761 ·
维护者通常 1 天内回复
查看 pytest-dev/pluggy 的全部 Issue
相似的 Issue
-
bug Size: XS
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
oposs/repo-infra#93 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 69/100
Graphify-Labs/graphify#4546 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
521xueweihan/HelloGitHub#4025 ·