Following the batteries-included philosophy doit includes some common used actions.
Creates a folder if it does not exist yet.
from doit.tools import create_folder
BUILD_PATH = "_build"
def task_build():
return {'actions': [(create_folder, [BUILD_PATH]),
'touch %(targets)s'],
'targets': ["%s/file.o" % BUILD_PATH]
}