def dependency(func, **config):
    """Declare a setter method to be called just after initializing a yaz.Plugin

    This decorator allows one or more plugin dependencies
    to be injected.  For example:

        class Helper(yaz.Plugin):
            pass

        class HelloWorld(yaz.Plugin):
            def __init__(self):
                self.helper = None

            @yaz.dependency
            def set_helper(self, helper: Helper):
                self.helper = helper

    In the above example, when the HelloWorld plugin is initialized,
    the set_helper method will be called immediately after the constructor
    finishes.

    Multiple dependencies may be injected in a single @yaz.dependency method.
    """
    func.yaz_dependency_config = config
    return func