Registry / devops / doit
library0.37.0pypypi✓ verified 23d ago

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 doit
INSTALL
IMPORT
SIG · DOIT
D
doit
devopspythonv0.37.0
Install
1.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.37.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Task Definition
def task_my_task(): return {'actions': ['echo "hello"']}
Tasks are typically defined as functions named `task_*` in a `dodo.py` file, which `doit` discovers and runs directly from the command line. Direct Python imports of a 'main' doit object are not the primary usage pattern.
doit.tools
from doit.tools import result_dep
For advanced task configurations, utilities like `result_dep`, `run_once`, or `config_changed` are imported from `doit.tools`.
DOIT_CONFIG
DOIT_CONFIG = {'verbosity': 2}
from doit.config import DOIT_CONFIG_FACTORY # (deprecated style)
Global configuration for doit is typically set in a `DOIT_CONFIG` dictionary directly in `dodo.py` or through `pyproject.toml`. While `doit_api.doit_config` exists for programmatically creating config, directly defining the dict is common. Old modules for config factories might be deprecated.

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.

import os def task_hello(): """create a greeting file""" return { 'actions': ['echo "Hello from doit" > hello.txt'], 'targets': ['hello.txt'], 'clean': True, } def task_shout(): """convert greeting to uppercase""" return { 'actions': ['tr a-z A-Z < hello.txt > shout.txt'], 'file_dep': ['hello.txt'], 'targets': ['shout.txt'], 'clean': True, } # To run this, save as dodo.py and execute in terminal: # $ doit # $ cat shout.txt # $ doit clean # (Note: 'tr' command is Unix-like, might need alternatives on Windows)
doit --version
Debug
Known issues
breakingVersion 0.37.0 dropped support for Python 3.8 and 3.9. The minimum required Python version is now 3.10. Prior versions also dropped support for older Python versions (e.g., 0.35.0 dropped 3.6/3.7).
fix
Ensure your project uses Python 3.10 or newer. Check the `CHANGES` file for specific version requirements if upgrading from older `doit` releases.
affects: >=0.37.0
breakingVersion 0.36.0 introduced several backward-incompatible changes, including the removal of the deprecated `doit.cmd_base.py:TaskLoader`, a switch from `toml` to `tomli` for configuration parsing, changes to how plugins are handled, and a restructuring of internal error classes (e.g., `CatchedException` renamed to `BaseFail`).
fix
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.
affects: >=0.36.0
gotchaTasks without explicitly defined `file_dep` (file dependencies) or `targets` will always be considered 'out-of-date' and re-run every time `doit` is executed, even if their actions have no side effects. This can lead to unnecessary re-execution.
fix
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.
affects: all
gotchaConfiguration files (`pyproject.toml`, `doit.cfg`, `dodo.py`'s `DOIT_CONFIG` variable) and command-line arguments have a specific precedence. Misunderstanding this hierarchy can lead to unexpected behavior where settings are not applied as intended, or `doit` fails to find tasks.
fix
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.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'doit'
The 'doit' library is not installed in the Python environment where the command is being executed.
fix
Install the doit library using pip: `pip install doit`
'doit' is not recognized as an internal or external command, operable program or batch file
The `doit` executable script is not found in the system's PATH environment variable, which commonly occurs on Windows or when Python's script directory isn't correctly configured in the PATH.
fix
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`.
TaskError - taskid:<task_id> Command error: '<command>'
A shell command executed as part of a `doit` task (`CmdAction`) returned a non-zero exit code, indicating that the command itself failed during execution.
fix
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.
Error: unknown task <task_name>
The task name specified on the command line does not exist in your `dodo.py` file, or there is a typo in the task name.
fix
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`.
doit.dependency.DatabaseException: db type is dbm.gnu, but the module is not available
The Python installation lacks the `gdbm` module, which `doit` uses for its dependency database. This often happens on Linux systems if `gdbm` development headers were not present when Python was compiled, or if `python-gdbm` (or similar) is not installed.
fix
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`).
Upgrade
Version history
0.37.0latest on PyPI · released Feb 9, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources