The rbext Tool¶
Review Board ships with a command line tool called rbext that can help you create and test your extension, helping you focus on writing new features for Review Board.
New in version 3.0.4.
rbext create is used to create an initial extension, complete with packaging. It can optionally set things up to distribute static files and to enable configuration.
At its simplest, you can create an extension with:
$ rbext create --name "My Extension"
my_extension package will be created with a basic, functioning extension
and packaging, ready to be modified.
There are several options available to customize the generation of your initial extension:
The name you want to give your extension. This should be a human-readable name, not a package name or a class name. Those can be provided separately, or will be generated from this name.
Sets a specific class name for your extension’s main class. This must be a valid Python class name, and must end with
If not set, a name will be generated based on the value passed in
Sets a specific version to use for the package and extension. This will be stored in the
setup.pyin your package. It defaults to “1.0”.
Sets a summary for the package’s
README.rstand for the extension information.
Sets a longer description for the package’s
Sets the name of the author for the package’s
setup.py. This can be an individual or the name of an organization/company.
Sets the e-mail address of the author for the package’s
setup.py. This can be any e-mail address suitable for contacting the developers of the package.
Whether to generate some files and options for providing a default form for configuring an extension. This will produce
forms.pyfiles, and set
is_configurable = Trueon the extension.
Learn more about how to customize the configuration of your extension.
rbext test is a handy tool for testing your extension, handling all the hard work of setting up an in-memory Review Board environment and database in which to run your test suite.
This is usually invoked like:
$ rbext test -m my_extension
See our guide to testing extensions for more information on how to incorporate a test suite into your extension.
There’s a few special arguments you may want to use:
The path to the root of your extension’s source tree (where
setup.pylives). This defaults to the current directory.
The name of the top-level module for your extension. This will look for any
tests.pyanywhere within the module.
Whether to include coverage information. This is used to show what lines of your code have been invoked through the test suite, and which lines have not been included in tests. See Showing Test Coverage for examples.
This requires the coverage module to be installed.
A list of modules/classes/functions to test can be included after any options. See Running Unit Tests on how to do this.