def dependency(target, source, commands):
    'Specify a dependency that is generated from an existing file.\n\n    Args:\n        target (str): Target file.\n        source (str): Source file.\n        commands (list[str]): List of commands to generate target file.\n    '
    if (not os.path.exists(target)):
        with wbml.out.Section('Generating file'):
            wbml.out.kv('Source', source)
            wbml.out.kv('Target', target)
            if (not os.path.exists(source)):
                raise DependencyError(f'Source "{source}" asserted to exist, but it does not.')
            current_wd = os.getcwd()
            make_dirs(target)
            for command in commands:
                wbml.out.out(command)
                os.chdir(os.path.dirname(target))
                subprocess.call(command, shell=True)
                os.chdir(current_wd)
Specify a dependency that is generated from an existing file.

Args:
    target (str): Target file.
    source (str): Source file.
    commands (list[str]): List of commands to generate target file.
def dependency(target, source, commands):
    'Specify a dependency that is generated from an existing file.\n\n    Args:\n        target (str): Target file.\n        source (str): Source file.\n        commands (list[str]): List of commands to generate target file.\n    '
    if (not os.path.exists(target)):
        with wbml.out.Section('Generating file'):
            wbml.out.kv('Source', source)
            wbml.out.kv('Target', target)
            if (not os.path.exists(source)):
                raise DependencyError(f'Source "{source}" asserted to exist, but it does not.')
            current_wd = os.getcwd()
            make_dirs(target)
            for command in commands:
                wbml.out.out(command)
                os.chdir(os.path.dirname(target))
                subprocess.call(command, shell=True)
                os.chdir(current_wd)