how does target work?

Skip to first unread message

Fotis Jannidis

Jul 9, 2020, 11:58:09 PM7/9/20
to python-doit

Hi all, I am trying to figure out, when doit is not executing an action. I thought I understood this from the tutorial, that it won't execute an action of the target exists (no check for change) and the dependencies have changed or are removed.

But when I use the example from the tutorial, it is always executed although the target exists. The []

 'verbosity': 2

def task_hello():

    def python_hello(targets):
        with open(targets[0], "a") as output:
            output.write("Python says Hello World!!!\n")

    return {
        'actions': [python_hello],
        'targets': ["hello.txt"],
After the first run the file hello.txt (and the database etc.) is created, so I assumed in the next run it won't be executed, but it is everytime I run doit.
I am using Python 3.7.6 (Windows 10) and doit (0, 32, 0). And I am starting doit on the commandline>python -m doit
Obviously I am missing something, but I cannot see what. Thanks in advance.

Eduardo Schettino

Jul 10, 2020, 12:04:48 AM7/10/20
to python-doit

You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Fotis Jannidis

Jul 10, 2020, 6:57:34 AM7/10/20
to python-doit
Thanks for the quick and helpful reply!

I read about 20 pages of the documentation (Tutorial and Tasks, which has a section on dependencies) without coming across this information, so I could imagine that it would be helpful to communicate this earlier,  especially because the behavior is not very intuitive and doit behaves here differently compared to similar tools. Maybe move it to the section ' Dependencies & Targets' in Tasks?
best wishes
Reply all
Reply to author
0 new messages