project_config.reporters package

Error reporters.

exception project_config.reporters.InvalidNotBasedThirdPartyReporter(message: str)[source]

Bases: ProjectConfigException

Reporter not based on base reporter class.

All reporters must be based on the base reporter class :py::class:project_config.reporters.base.BaseReporter.

exception project_config.reporters.InvalidThirdPartyReporterName(reporter_id: str)[source]

Bases: ProjectConfigException

A third party reporter can’t be loaded by his identifier.

exception project_config.reporters.InvalidThirdPartyReportersModule(message: str)[source]

Bases: ProjectConfigException

Third party reporters module is invalid.

Third party reporters module must expose a color and a black/white reporter.

class project_config.reporters.ThirdPartyReporters[source]

Bases: object

Third party reporters loader from entrypoints.

_prepare_third_party_reporters() None[source]
property ids: list[str]

Returns the identifiers of the 3rd party reporters.

instance: project_config.reporters.ThirdPartyReporters | None = None
load(reporter_name: str) module[source]

Load a third party reporter.

Parameters:

reporter_name (str) – Reporter module entrypoint name.

validate_reporter_class(reporter_class: Any) None[source]

Validate a reporter class.

Parameters:

reporter_class (type) – Reporter class to validate.

validate_reporter_module(reporter_module: module) tuple[str, str][source]

Validate a reporter module.

Returns black/white and color reporter class names if the reporters module is valid.

Parameters:

reporter_module (type) – Reporters module to validate.

exception project_config.reporters.UnparseableReporterError(reporter_id: str)[source]

Bases: ProjectConfigException

Reporter can’t be parsed.

project_config.reporters._parse_reporter_arguments(arguments_string: str) dict[str, Any][source]
project_config.reporters.get_reporter(reporter_name: str, reporter_kwargs: dict[str, Any], color: bool | None, rootdir: str, only_hints: bool = False) Any[source]

Reporters factory.

Parameters:
  • reporter_name (str) – Reporter identifier name.

  • reporter_kwargs (dict) – Optional arguments for reporter class.

  • color (bool) – Return the colorized version of the reporter, if is implemented, using the black/white version as a fallback.

  • rootdir (str) – Root directory of the project.

  • only_hints (bool) – If True, only hints will be reported.

project_config.reporters.parse_reporter_id(value: str) tuple[str, dict[str, Any]][source]

Parse a reporter identifier.

Returns the reporter name and the optional arguments for his class.

Parameters:

value (str) – Reporter identifier.

Submodules