Extensions

Changed in version 2.7: releng-tool will now stop if an extension fails to load.

Changed in version 2.7: releng-tool projects can define a releng_setup hook in their project configurations to perform similar actions as extensions can.

A releng-tool project can use an extension by registering the extension name in the extensions configuration option inside the project configuration (releng). For example, to load an extension my_awesome_extension into releng-tool, the following can be defined:

extensions = [
   'my_awesome_extension',
]

During the initial stages of a releng-tool process, the process will check and load any configured extension. In the event that an extension is missing, is unsupported for the running releng-tool version or fails to load; a detailed error message will be presented to the user.

Extensions are typically Python packages installed for the running Python environment. If extensions are not packaged/installed, users can alternatively append the location of an extension implementation into the system path in the releng-tool configuration file. For example, if a user has a releng-tool project checked out alongside a checked out extension in a folder named my-awesome-extension, the extension's path can be registered into the system path using the following:

releng_register_path(ROOT_DIR.parent / 'my-awesome-extension')

While the ability to load extensions is supported, capabilities provided by extensions are not officially supported by releng-tool. For issues related to specific extension use, it is recommended to see the documentation provided by the providers of said extensions.

For developers interesting in implementing extensions, a list of available API interfaces and documentation for these interfaces can be found inside the API implementation. Implementation in the API folder aims to be "API safe" -- there is a strong attempt to prevent the changing of classes, methods, etc. to prevent compatibility issues as both releng-tool and extensions (if any) evolve.

Advanced users may also register application hooks by defining a releng_setup hook in their project's releng-tool.rt configuration. For example:

def releng_setup(app):
    ...

Examples

The following provides a series of examples for developers on how to develop extensions for releng-tool: