lemon24 / reader

A Python feed reader library.
https://reader.readthedocs.io
BSD 3-Clause "New" or "Revised" License
456 stars 38 forks source link

Consider using pluggy for plugin management #329

Closed lemon24 closed 1 month ago

lemon24 commented 11 months ago

https://pluggy.readthedocs.io/

Pros:

Cons:

lemon24 commented 1 month ago

I had another look at pluggy, and confirm the pros still stand.

However, the following two cons remain:

  • update-style hooks where we continue to run after failure may be fiddly to implement
  • requests wrapper style hooks where the return value from a plugin is passed to the next plugin might be fiddly to implement

As far as I can see, the calling logic is buried deep within the codebase, so it likely can't be / isn't meant to be changed.

There's also https://github.com/pytest-dev/pluggy/issues/419 says collecting exceptions is out of scope, but it also mentioned further down that it may be solved in https://github.com/pytest-dev/pluggy/issues/321; it may be worth describing the reader usage patterns in that issue?

lemon24 commented 1 month ago

Added https://github.com/pytest-dev/pluggy/issues/151#issuecomment-2421648901 describing the current use cases, and also how one may work around the current pluggy model to implement them.

even if using pluggy would require some work-arounds for calling, I think the collection / discovery functionality is still more than worth it

I'd say long-term and/or if reader becomes really popular, pluggy is definitely the way to go, but for now I'll close this as YAGNI (yet).