Xtrigger Plugins

Added in version 8.3: Xtrigger plugins allow you to install and use xtriggers without them being in <workflow-dir>/lib/python/ or $CYLC_PYTHONPATH.

Developing xtrigger plugins

Cylc uses the cylc.xtriggers entry point registered by setuptools to search for xtrigger plugins. Each xtrigger is registered individually.

Example

Consider a package called my_package with the following structure:

my_package/foo.py
def foo():
    ...

def bar():
    ...
my_package/baz.py
def baz():
    ...

These xtriggers can be registered in the package’s setup.cfg or pyproject.toml file.

setup.cfg
[options.entry_points]
cylc.xtriggers =
    foo = my_package.foo
    bar = my_package.foo
    baz = my_package.baz
pyproject.toml
[project.entry-points."cylc.xtriggers"]
foo = "my_package.foo"
bar = "my_package.foo"
baz = "my_package.baz"

Tip

It is recommended to implement only one xtrigger per module. This allows you to write a validate function for each xtrigger - see Xtrigger Validation Functions.