Tools¶
A recipe step can need tools, such as a compiler. Steps express this as
tool sets: each set names tools that together satisfy the step. The
options package defines tool sets for recipe handling. The protocol
carries them as ToolSet messages, defined in the tool protocol.
This module converts between the two forms:
from momotor.rpc.proto.tool_pb2 import ToolSet
from momotor.rpc.tools import message_to_toolsets, toolsets_to_message
messages = list(toolsets_to_message([frozenset({'gcc'}), frozenset({'clang'})]))
toolsets = list(message_to_toolsets([ToolSet(tool=['gcc'])]))
messages now holds one ToolSet message per set, and toolsets
holds [frozenset({'gcc'})].
API reference¶
- momotor.rpc.tools.message_to_toolsets(toolset_message)¶
Convert a sequence of
ToolSetprotocol messages back into tool sets
- momotor.rpc.tools.toolsets_to_message(toolsets)¶
Convert an iterable of tool sets into
ToolSetprotocol messages