validate_pyproject.plugins package#

Module contents#

exception validate_pyproject.plugins.ErrorLoadingPlugin(plugin: str = '', entry_point: EntryPoint | None = None)[source]#

Bases: RuntimeError

There was an error loading ‘{plugin}’. Please make sure you have installed a version of the plugin that is compatible with {package} {version}. You can also try uninstalling it.

class validate_pyproject.plugins.PluginWrapper(tool: str, load_fn: Callable[[str], Schema])[source]#

Bases: object

property help_text: str#
property id#
property schema#
property tool#
validate_pyproject.plugins.iterate_entry_points(group='validate_pyproject.tool_schema') Iterable[EntryPoint][source]#

Produces a generator yielding an EntryPoint object for each plugin registered via setuptools entry point mechanism.

This method can be used in conjunction with load_from_entry_point to filter the plugins before actually loading them.

validate_pyproject.plugins.list_from_entry_points(group: str = 'validate_pyproject.tool_schema', filtering: ~typing.Callable[[~importlib.metadata.EntryPoint], bool] = <function <lambda>>) List[PluginWrapper][source]#

Produces a list of plugin objects for each plugin registered via setuptools entry point mechanism.

  • group – name of the setuptools’ entry point group where plugins is being registered

  • filtering – function returning a boolean deciding if the entry point should be loaded and included (or not) in the final list. A True return means the plugin should be included.

validate_pyproject.plugins.load_from_entry_point(entry_point: EntryPoint) PluginWrapper[source]#

Carefully load the plugin, raising a meaningful message in case of errors