craft_parts.executor.executor module¶
Definitions and helpers for the action executor.
- class craft_parts.executor.executor.ExecutionContext(*, executor)¶
Bases:
objectA context manager to handle lifecycle action executions.
- Parameters:
executor (
Executor)
- execute(actions, *, stdout=None, stderr=None)¶
Execute the specified action or list of actions.
- class craft_parts.executor.executor.Executor(*, part_list, project_info, extra_build_packages=None, extra_build_snaps=None, track_stage_packages=False, ignore_patterns=None, base_layer_dir=None, base_layer_hash=None, use_host_sources=False, build_environment=None)¶
Bases:
objectExecute lifecycle actions.
The executor takes the part definition and a list of actions to run for a part and step. Action execution is stateless: no information is kept from the execution of previous parts. On-disk state information written after running each action is read by the sequencer before planning a new set of actions.
- Parameters:
project_info (
ProjectInfo) – Information about this project.track_stage_packages (
bool) – Add primed stage packages to the prime state.extra_build_packages (
list[str] |None) – Additional packages to install on the host system.extra_build_snaps (
list[str] |None) – Additional snaps to install on the host system.ignore_patterns (
list[str] |None) – File patterns to ignore when pulling local sources.use_host_sources (
bool) – Whether overlay steps should also include the repository sources defined on the host.build_environment (
Iterable[str] |None) – The environment variables to be set during build.
- clean(initial_step, *, part_names=None)¶
Clean the given parts, or all parts if none is specified.
- epilogue()¶
Finish and clean the execution environment.
This method is called after executing lifecycle actions.
- Return type:
- execute(actions, *, stdout=None, stderr=None)¶
Execute the specified action or list of actions.