You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: declarative ordering of hookimpls relative to other plugins (before/after), beyond tryfirst/trylast #705
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:
undeterministic order of pytest_configure for contest loaded plugins 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."
Question about hook call order #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.
Activity