Skip to content

document implprefix argument? #114

@anthrotype

Description

@anthrotype

Hi,
I'm new to the project and I'm considering using pluggy in my own application.
So I started by looking at pluggy's documentation, as well as the way it's being used by pytest.

While looking at the latter, I noticed that the PluginManager can also take a implprefix argument in order to search for matching names in a plugin namespace to be registered as hook implementations.
I also noticed pytest plugins have hooks prefixed with "pytest_", and it doesn't seem necessary to mark implementations with pytest.hookimpl decorator to make them discoverable; the latter is of course required if one wishes to customize the behavior of a hook (by passing options to the decorator like hookwrapper, optionalhook, etc.).

As far as I can see, the main pluggy documentation at http://pluggy.readthedocs.io/en/latest/ only mentions the HookimplMarker decorator as the way to mark a function for detection by a PluginManager's register method.
It's true that implprefix is mentioned in the "Public API" section of the docs, as it's in the PluginManager's docstring. However, maybe it could be featured more prominently in the main section?

Or is this intentional and the decorator approach is the method which should be preferred for detection of hook implementations?

Thank you

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions