vmklib.tasks.mixins package#

Submodules#

vmklib.tasks.mixins.concrete module#

A task mixin for writing concrete outputs to a build directory.

class vmklib.tasks.mixins.concrete.ConcreteBuilderMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: VmklibBase

Create a concrete file output after a task completes.

concrete_path(inbox: Dict[str, Dict[str, Any]], substitutions: Dict[str, str | int] = None) Path[source]#

By default name the concrete after the compiled target name.

is_concrete_stale(inbox: Dict[str, Dict[str, Any]], candidates: Iterable[Path | str | None], substitutions: Dict[str, str | int] = None) bool[source]#

Check if any candidate paths are modified after the concrete was.

async run_exit(_inbox: Dict[str, Dict[str, Any]], _outbox: Dict[str, Any], *_args, **kwargs) bool[source]#

Update the concrete target after main execution by default.

update_concrete(inbox: Dict[str, Dict[str, Any]], **kwargs) Path[source]#

Write a text file to disk in the build directory based on the name of this task.

This is useful to bootstrap compatibility with other tools like GNU Make that assess concrete targets.

class vmklib.tasks.mixins.concrete.ConcreteOnceMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: ConcreteBuilderMixin

A mixin for tasks that only need to run once.

async run_enter(_inbox: Dict[str, Dict[str, Any]], _outbox: Dict[str, Any], *_args, **_kwargs) bool[source]#

Ensure that this task only runs once.

vmklib.tasks.mixins.curl module#

A module for working with curl commands.

class vmklib.tasks.mixins.curl.CommandResult(code: int, stdout: str, stderr: str)[source]#

Bases: NamedTuple

A container for a system command result.

code: int#

Alias for field number 0

stderr: str#

Alias for field number 2

stdout: str#

Alias for field number 1

class vmklib.tasks.mixins.curl.CurlMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: SubprocessLogMixin

A task for generating ninja configurations.

async curl(*args: str, post_data: Dict[str, Any] = None, headers: Dict[str, str] = None, method: str = None) CommandResult[source]#

Run a curl command.

vmklib.tasks.mixins.curl.curl_headers(data: Dict[str, str]) Iterator[str][source]#

Get header arguments for curl based on some header data.

Module contents#

A module for aggregating mixin classes.

class vmklib.tasks.mixins.CommandResult(code: int, stdout: str, stderr: str)[source]#

Bases: NamedTuple

A container for a system command result.

code: int#

Alias for field number 0

stderr: str#

Alias for field number 2

stdout: str#

Alias for field number 1

class vmklib.tasks.mixins.ConcreteBuilderMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: VmklibBase

Create a concrete file output after a task completes.

concrete_path(inbox: Dict[str, Dict[str, Any]], substitutions: Dict[str, str | int] = None) Path[source]#

By default name the concrete after the compiled target name.

is_concrete_stale(inbox: Dict[str, Dict[str, Any]], candidates: Iterable[Path | str | None], substitutions: Dict[str, str | int] = None) bool[source]#

Check if any candidate paths are modified after the concrete was.

async run_exit(_inbox: Dict[str, Dict[str, Any]], _outbox: Dict[str, Any], *_args, **kwargs) bool[source]#

Update the concrete target after main execution by default.

update_concrete(inbox: Dict[str, Dict[str, Any]], **kwargs) Path[source]#

Write a text file to disk in the build directory based on the name of this task.

This is useful to bootstrap compatibility with other tools like GNU Make that assess concrete targets.

class vmklib.tasks.mixins.ConcreteOnceMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: ConcreteBuilderMixin

A mixin for tasks that only need to run once.

async run_enter(_inbox: Dict[str, Dict[str, Any]], _outbox: Dict[str, Any], *_args, **_kwargs) bool[source]#

Ensure that this task only runs once.

class vmklib.tasks.mixins.CurlMixin(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: SubprocessLogMixin

A task for generating ninja configurations.

async curl(*args: str, post_data: Dict[str, Any] = None, headers: Dict[str, str] = None, method: str = None) CommandResult[source]#

Run a curl command.

vmklib.tasks.mixins.curl_headers(data: Dict[str, str]) Iterator[str][source]#

Get header arguments for curl based on some header data.