def add_f2py_tasks(task_gen, f2py_task, module_name, module_node):
    build_dir = module_node.parent.bldpath()
    # FIXME: ask waf ML how flags sharing and co is supposed to work
    f2py_task.env.F2PYFLAGS = task_gen.env.F2PYFLAGS[:]
    f2py_task.env.F2PYFLAGS.extend(["--build-dir", build_dir])
    task_gen.source += f2py_task.outputs

    fobject_node = module_node.parent.find_or_declare("%s-fortranobject.c" % module_name)
    fobject_task = task_gen.create_task("f2py_fortran_object", [], fobject_node)
    task_gen.source += fobject_task.outputs

    fwrapper_node = module_node.parent.find_or_declare(module_name % FWRAP_TEMPLATE)
    fwrapper_task = task_gen.create_task("f2py_fwrapper", [], fwrapper_node)
    task_gen.source += fwrapper_task.outputs
dataset/ETHPy150Open cournape/Bento/bento/backends/waf_tools/f2py.py/add_f2py_tasks/swapped operands of `%`