pytest-dev/pluggy

Plugins must be hashable

texastony opened this issue · 3 comments

if plugin_name in self._name2plugin or plugin in self._plugin2hookcallers:

Is it documented that Plugins must be hashable? Or am I missing something?

Utilizing @attr.s(hash=True) solved this issue for me, but if Plugin classes must be hashable, that should be documented...

Since the Plugin is going to be the key for the pm._plugin2hookcallers, this is the case.

hashable_plugin_pluggy

I searched for hashable in the README and in the issues. I found nothing.

Hi @texastony,

Indeed that should be documented. Would you like to contribute a PR?

I leave town for a week and have a lot on my plate... but if this is still open in a few weeks I will submit.
(Eh... this is small...)

I believe the statement would be added to https://pluggy.readthedocs.io/en/stable/#implementations,

Somewhere in lines L219-L226 of docs/index.rst.

Is the same true for hookspecs? I am still playing with the library for my project...

Pending maintainer approval for github check: #329