doit

doit is a Python task runner and build tool for defining reproducible workflows. You describe tasks in Python with explicit dependencies and targets, and doit runs only what’s out of date, skipping work when inputs and outputs haven’t changed.

Installation and Setup

Install it from PyPI:

Windows PowerShell
(venv) PS> py -m pip install doit
Shell
(venv) $ python -m pip install doit

Key Features

  • Defines tasks in a dodo.py file using task_*() functions that return or yield task dictionaries.
  • Skips up-to-date work by tracking declared dependencies and targets and re-running tasks only when inputs change.
  • Runs tasks in parallel using processes by default. Supports thread-based parallelism when requested.
  • Provides a rich CLI for listing tasks and managing state, for example, using the list, info, forget, and clean commands.
  • Configures defaults via pyproject.toml under [tool.doit] or using the legacy doit.cfg.
  • Enables file watching via plugins, such as doit-watch.

Usage

Create a dodo.py file and define tasks that return dictionaries:

Python dodo.py
def task_run_tests():
    return {"actions": ["pytest -q"]}

def task_compile():
    return {
        "actions": ["pip-compile requirements.in -o requirements.txt"],
        "file_dep": ["requirements.in"],
        "targets": ["requirements.txt"],
    }

Run all default tasks:

Shell
$ doit

List available tasks with short descriptions:

Shell
$ doit list

Execute a specific task:

Shell
$ doit tests compile

Run tasks in parallel using processes or threads:

Shell
$ doit -n 4            # Processes
$ doit -n 4 -P thread  # Threads

Force a task to be considered out of date on the next run:

Shell
$ doit forget compile

Remove generated targets:

Shell
$ doit clean

By Leodanis Pozo Ramos • Updated Dec. 17, 2025