Skip to content

bypass task execution based on hash/timestamp #100

@deanmalmgren

Description

@deanmalmgren

I've been looking for an alternative to GNU's make for managing a sequence of data analysis tasks and was delighted to discover invoke this morning!

One nice thing about GNU's make is that it only runs build tasks if the target's timestamp (other tools use a hash of the target's contents) is out of date with the build task's dependencies. This is convenient because if we have a dependency sequence A -> B and task A takes a very long time to run (hours or days), then its nice to bypass step A in subsequent build steps. Example:

make      # runs A and then B
edit B
make      # runs B but does not run A because A hasn't changed since last build

Does invoke have similar functionality or any plans to incorporate that functionality if it doesn't exist?

My understanding is that an equivalent invoke script would look something like this:

@task
def A():
    time.sleep(24*60*60) # a very long running task
    print("A is done")

@task(pre=['A'])
def B():
    print("B is done")

@task(pre=['A', 'B'])
def all():
    print("all is done")

but the equivalent output is not the same

invoke all     # runs A then B
edit B
involke all    # runs A then B again :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions