ward icon indicating copy to clipboard operation
ward copied to clipboard

Display which plugins have been discovered/loaded

Open darrenburns opened this issue 3 years ago • 4 comments

In the SessionPrelude (the bit of text that prints out at the top of every test session) we should display the names of the plugins that have been discovered (Ward automatically discovers plugins after they've been e.g. pip installed).

Here's how you'd get the list of plugins: https://pluggy.readthedocs.io/en/latest/api_reference.html#pluggy.PluginManager.

The PluginManager inside Ward can be found in hooks.py.

Here's the relevant bit of code that prints out the prelude: https://github.com/darrenburns/ward/blob/master/ward/_terminal.py#L458

Ideally, the list of plugins discovered will appear on the line above the "Loaded config from pyproject.toml".

darrenburns avatar May 25 '21 00:05 darrenburns

Hi! Can I work on this issue?

drunkeninja42 avatar Aug 19 '21 00:08 drunkeninja42

Hi @drunkeninja42, yeah feel free to pick it up if you'd like to 🙂

darrenburns avatar Aug 25 '21 17:08 darrenburns

Hello @darrenburns , can i create a pull request to add this feature? if this issue still relevant.

I want to add code something like this to SessionPrelude class:

    list_of_plugins: List = plugins.list_name_plugin()
    if list_of_plugins:
        yield f"The list of plugins discovered: {[name for name, plugin in list_of_plugins]}"

daserok avatar Oct 24 '21 14:10 daserok

Yes 🙂

darrenburns avatar Oct 24 '21 15:10 darrenburns