RepoBee Module Reference
This is the public API of the
repobee module, which is primarily intended
for testing of plugins, but could also be used to execute RepoBee from a Python
script. For the internal API of the
_repobee package, please see the
- repobee.run(cmd, config_file='', plugins=None, workdir='.')
Run RepoBee with the provided options. This function is mostly intended to be used for testing plugins.
This function will always unregister all plugins after execution, including anly plugins that may have been registered prior to running this function.
Running this function is almost equivalent to running RepoBee from the CLI, with the following exceptions:
Preparser options must be passed as arguments to this function (i.e. cannot be given as part of
There is no error handling at the top level, so exceptions are raised instead of just logged.
As an example, the following CLI call:
$ repobee --plug ext.py --config-file config.ini config show
Can be executed as follows:
import ext from repobee import run run(["config", "show"], config_file="config.ini", plugins=[ext])
- Return type:
A mapping (plugin_name -> plugin_results).
- repobee.try_register_plugin(plugin_module, *plugin_classes)
Attempt to register a plugin module and then immediately unregister it.
This is a convenience method for sanity checking plugins, and should only be called in test suites. It’s not for production use.
This convenience method can be used to sanity check plugins by registering them with RepoBee. If they have incorrectly defined hooks, this will be discovered only when registering.
As an example, assume that we have a plugin module with a single (useless) plugin class in it, like this:
import repobee_plug as plug class Useless(plug.Plugin): """This plugin does nothing!"""
We want to make sure that both the
uselessmodule and the
Uselessplugin class are registered correctly, and for that we can write some simple code like this.
import repobee # assuming that useless is defined in the external plugin # repobee_useless from repobee_useless import useless def test_register_useless_plugin(): repobee.try_register_plugin(useless, useless.Useless)
or if the contained plugin classes does not match –
- Return type: