pluggy icon indicating copy to clipboard operation
pluggy copied to clipboard

Handle specname hooks in subset callers

Open CodingFeng101 opened this issue 5 months ago • 0 comments

What changed

PluginManager.subset_hook_caller() now builds its exclusion set from the hook implementations registered on the target hook instead of checking whether each plugin has an attribute with the hook name.

Why

A plugin can implement a hook through @hookimpl(specname="..."), so the plugin object does not need to expose an attribute with the hook name. In that case, subset_hook_caller() previously failed to exclude the plugin and the implementation still ran.

Validation

  • PYTHONPATH=src python -m pytest testing\test_pluginmanager.py::test_subset_hook_caller_with_specname testing\test_pluginmanager.py::test_subset_hook_caller -q
  • PYTHONPATH=src python -m pytest testing\test_pluginmanager.py -q
  • PYTHONPATH=src python -m pytest -q
  • uv run pytest -q
  • uv run pre-commit run -a

CodingFeng101 avatar Jun 30 '26 09:06 CodingFeng101