A functional interface for creating doit tasks
Project description
This package provides a functional interface for reducing boilerplate in dodo.py
of the pydoit build system. In short, all tasks are created and managed using a doit_interface.Manager
. Most features<features>
are exposed using python context manager, e.g., grouping tasks.
Example
>>> import doit_interface as di
>>> manager = di.Manager.get_instance()
>>> # Create a single task.
>>> manager(basename="create_foo", actions=["touch foo"], targets=["foo"])
{'basename': 'create_foo', 'actions': ['touch foo'], 'targets': ['foo'], ...}
>>> # Group multiple tasks.
>>> with di.group_tasks("my_group") as my_group:
... manager(basename="member")
{'basename': 'member', ...}
>>> my_group
<doit_interface.contexts.group_tasks object at 0x...> named `my_group` with 1 task
>>> # Show the task we implicitly constructed using `group_tasks`.
>>> dict(my_group)
{'basename': 'my_group', 'actions': [], 'task_dep': ['member'], ...}
Features
Traceback for failed tasks using
doit_interface.DoitInterfaceReporter
.Group tasks to easily execute all of them using
doit_interface.group_tasks
.Automatically create directories for targets using
doit_interface.create_target_dirs
.Share default values amongst tasks, such as
file_dep
orbasename
usingdoit_interface.defaults
.Use task
dict
s as dependencies infile_dep
ortask_dep
usingdoit_interface.normalize_dependencies
.Apply prefixes using
doit_interface.path_prefix
ordoit_interface.prefix
.Use global environments and extensive variable substitution for command line tasks using
doit_interface.SubprocessAction
. You can also usedoit_interface.SubprocessAction
by default using thedoit_interface.SubprocessAction.use_as_default
context manager.
Interface
doit_interface
:members:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.