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 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 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 or basename using doit_interface.defaults.

  • Use task dicts as dependencies in file_dep or task_dep using doit_interface.normalize_dependencies.

  • Apply prefixes using doit_interface.path_prefix or doit_interface.prefix.

  • Use global environments and extensive variable substitution for command line tasks using doit_interface.SubprocessAction. You can also use doit_interface.SubprocessAction by default using the doit_interface.SubprocessAction.use_as_default context manager.

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.7.tar.gz (10.2 kB view details)

Uploaded Source

File details

Details for the file doit_interface-0.1.7.tar.gz.

File metadata

  • Download URL: doit_interface-0.1.7.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for doit_interface-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f0d63f56ecd2cc45bd9ea0f9900f34d796a6d3cdc6d5c1946f80b90af428b82e
MD5 af6e76d46091932671111892b0ef11a3
BLAKE2b-256 0927b7d3bb5a8156987100e85248cb3d5d9b758ace5c8e079c92541c735b8d49

See more details on using hashes here.

Supported by

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