Feature request: declarative ordering of hookimpls relative to other plugins (before/after), beyond tryfirst/trylast
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先阅读当前 tryfirst 和 trylast hook 的排序行为,以及所引用的 pytest issue。该 issue 还指出,_HookCaller._nonwrappers 是用户目前会检查的 private API。要完成这项工作,需要先为声明式排序制定一个获认可的设计,包括冲突和循环,然后进行实现和测试;维护者目前质疑这是否值得投入。
由索引模型根据 Issue 内容生成。
描述
pluggy currently offers only tryfirst and trylast booleans to control hook order, which remains arbitrary within each of the three categories. Some users want to declare that their hookimpl must run before or after a specific other plugin or hookimpl, and so several pytest issues conclude that the fix (if any) belongs in pluggy:
- pytest-dev/pytest#13371 — "Provide a better way to schedule hooks ordering." Request for
before=/after=ordering relative to named plugins. - pytest-dev/pytest#2364 — "undeterministic order of pytest_configure for conftest-loaded plugins." Core/entrypoint/conftest plugins end up in an effectively random relative order; the issue explicitly notes "this may need actual dependency ordering support in pluggy."
- #250 — an existing user question about reordering hookimpls after registration by poking
_HookCaller._nonwrappers(private API), which shows people already reach for unsupported internals to get this.
Personally I'm inclined to close this issue as wontfix, because it's absolutely classic "what if two programs did this" fodder. Even if we proposed to error on such cases and do a fancy toposort on the rest, I don't think it'd be worth the complexity.
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 187
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 23
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pytest-dev/pluggy 的其他 Issue
-
Plugin registry compares plugins by equality, not identity可能已有人在做 @00200200 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
pytest-dev/pluggy#760 ·
维护者通常 1 天内回复
-
Hook tracing crashes with specced Mock arguments and results可能已有人在做 @RonnyPfannschmidt 今天认领。 未关闭
难度 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 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 42/100
pytest-dev/pluggy#762 ·
维护者通常 1 天内回复
查看 pytest-dev/pluggy 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
cellrishi-code/claude-skills-atlas#165 ·
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 72/100
open-webui/open-webui#32635 · 1 条评论 ·
维护者通常 1 天内回复
-
Filters: ?field:ne=null matches NULL rows instead of non-NULL ones可能已有人在做 @rshdhere 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Netflix/metaflow-service#504 ·
-
needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
gke-labs/kube-agents#3394 ·
维护者通常 1 天内回复
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)可能已有人在做 @O1sumitkumar 今天认领。 未关闭bug good first issue help wanted python
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复