[docs]classPluginManager:""" A class to load and manage plugins. By default in asv, plugins are searched for in the :py:mod:`asv.plugins` namespace package and in the :py:mod:`asv.commands` package. Then, any modules specified in the ``plugins`` entry in the ``asv.conf.json`` file are loaded. """def__init__(self):
[docs]defload_plugins(self,package):prefix=package.__name__+"."formodule_finder,name,ispkginpkgutil.iter_modules(package.__path__,prefix):try:mod=importlib.import_module(name)self.init_plugin(mod)self._plugins.append(mod)exceptModuleNotFoundErroraserr:ifany(keywordinnameforkeywordinENV_PLUGINS):continue# Fine to not have theseelse:log.error(f"Couldn't load {name} because\n{err}")