pluggy
pluggy copied to clipboard
Move tracing "intercept" methods to `_HookCaller`?
This relates to #217 as well as discussion in other issues.
The main refactoring would include:
- moving
PluginManager._inner_hookexeclambdaindirection onto the_HookCaller - possibly (and subsequently) remove
PluginManager._hookexecentirely - re-work the tracing methods to support per hook tracing and if global tracing is desired have the manager loop through all underlying callers to insert trace functions.
The first point is covered by #280.
For the second point I have a plan as well, will submit after the first PR is merged.
As for point 3, it should be possible, however the implementation plan of iterating over all _HookCallers is foiled by PluginManager.subset_hook_caller() which returns an untracked _HookCaller (and we probably don't want to track it, unless using weak references).