doit is a Python-native task management and automation tool, similar to 'make' but entirely in Python. It allows users to define tasks as Python functions returning dictionaries, tracks file and task dependencies, caches results, and executes only what has changed, enabling incremental builds and reproducible workflows. As of version 0.37.0, it supports Python 3.10+ and is actively maintained with regular updates.
pip install doitVerified import paths — ran on the pinned version, not inferred.
Create a file named `dodo.py` with task definitions. `doit` automatically discovers tasks named `task_*`. Tasks are Python functions that return a dictionary describing their actions, dependencies (`file_dep`), and outputs (`targets`). Running `doit` from the command line executes these tasks, honoring dependencies and skipping up-to-date tasks.
Ensure your project uses Python 3.10 or newer. Check the `CHANGES` file for specific version requirements if upgrading from older `doit` releases.
Review the `CHANGES` file for version 0.36.0 on the official GitHub repository. Update custom task loaders, plugin integrations, or exception handling code accordingly. Consider adding `tomli` if directly interacting with TOML files for configuration.
For tasks that produce output or depend on specific inputs, always specify `file_dep` and `targets` to enable `doit`'s incremental build capabilities. If a task truly should run every time, explicitly add `uptodate=False` to its return dictionary.
Consult the `doit` documentation on configuration options and precedence. For global project configuration, `pyproject.toml` (`[tool.doit]` section) or a `DOIT_CONFIG` dictionary in `dodo.py` are common. Ensure paths are correctly handled, especially when using `src` layouts or non-standard `dodo.py` locations.
Install the doit library using pip: `pip install doit`
Ensure Python's scripts directory (e.g., `C:\PythonXX\Scripts` on Windows, or the virtual environment's `bin` directory on Linux/macOS) is added to your system's PATH environment variable, or execute doit using `python -m doit`.
Debug the underlying shell command (`<command>`) by running it directly in your terminal to understand why it's failing. The `doit` output usually includes the full command that was executed.
Verify the task name you are trying to run against the tasks defined in your `dodo.py` file. You can list all available tasks using `doit list`.
Install the `gdbm` development package for your system (e.g., `sudo apt-get install libgdbm-dev` on Debian/Ubuntu, `sudo yum install gdbm-devel` on RHEL/Fedora) and then reinstall or recompile Python, or install the Python `gdbm` package if available (e.g., `pip install python-gdbm` or `conda install gdbm`).
No dependency data recorded yet.