Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/tox/plugin/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the plugin manager object"""
import logging
from typing import List, Type, cast

import pluggy
Expand Down Expand Up @@ -42,12 +43,16 @@ def __init__(self) -> None:
)

for plugin in internal_plugins:
logging.info("Registering %s", plugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to be silent if nothing bad happens.

self.manager.register(plugin)
self.manager.load_setuptools_entrypoints(NAME)
self.manager.register(state)
try:
self.manager.load_setuptools_entrypoints(NAME)
self.manager.register(state)

REGISTER.populate(self)
self.manager.check_pending()
REGISTER.populate(self)
self.manager.check_pending()
except ImportError as e:
logging.warning("Ignored plugin %s which failed to load. %s", NAME, e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you want %r to show the type too. And ideally, we'd also show the last source code line of the traceaback (you can get it via traceback.format_exc).


def tox_add_option(self, parser: ToxParser) -> None:
self.manager.hook.tox_add_option(parser=parser)
Expand Down