Skip to main content

A functional interface for creating doit tasks

Project description

https://github.com/tillahoffmann/doit_interface/actions/workflows/main.yml/badge.svg https://img.shields.io/pypi/v/doit_interface.svg?style=flat-square https://readthedocs.org/projects/doit-interface/badge/?version=latest

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 functionality is 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
group `my_group` with 1 task
>>> # Show the task we implicitly constructed using `group_tasks`.
>>> dict(my_group)
{'basename': 'my_group', 'actions': [], 'task_dep': ['member'], ...}

Interface

doit_interface
 :members:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doit_interface-0.1.2.tar.gz (8.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page