craftr.core.executor

craftr.core.executor.default

A very simple, sequential executor.

craftr.core.executor.graph

ExecutionGraph Objects

class ExecutionGraph()

The execution graph contains a plan for the order in which tasks need to be executed. It is accessible via the Context.graph property, but it will be empty until all projects have been evaluated and Context.execute() is called.

The execution graph contains only those tasks that are selected for execution. Some tasks may not be included by default (if Task.default is set to False) or are skipped because they have not been explicitly selected.

when_ready

 | when_ready(closure: t.Callable[['ExecutionGraph'], None]) -> None

Adds a callback that is invoked when the execution graph is ready. If the graph is ready by the time this method is called, the closure is invoked immediately.

ready

 | ready() -> None

Declare that the execution graph is ready. Invokes registered listeners.

add_task

 | add_task(task: Task) -> None

Add a task and all it's dependencies to the graph.

has_task

 | has_task(task: t.Union[str, Task]) -> bool

Returns True if the specified task (either the absolute path of the task or the Task instance itself) is contained in the execution graph.

get_ordered_tasks

 | get_ordered_tasks() -> t.List[Task]

Retrieve the tasks of the execution graph in the order that they need to be executed.

craftr.core.executor.api