craft_parts.sequencer module

Determine the sequence of lifecycle actions to be executed.

class craft_parts.sequencer.Sequencer(*, part_list, project_info, ignore_outdated=None, base_layer_hash=None)[source]

Bases: object

Obtain a list of actions from the parts specification.

The sequencer takes the parts definition and the current state of a project to plan all the actions needed to reach a given target step. State is read from persistent storage and updated entirely in memory. Sequencer operations never change disk contents.

Parameters:
  • part_list (list[Part]) – The list of parts to process.

  • project_info (ProjectInfo) – Information about this project.

  • ignore_outdated (Optional[list[str]]) – A list of file patterns to ignore when testing for outdated files.

  • base_layer_hash (Optional[LayerHash])

plan(target_step, part_names=None, *, rerun=False)[source]

Determine the list of steps to execute for each part.

Parameters:
  • target_step (Step) – The final step to execute for the given part names.

  • part_names (Optional[Sequence[str]]) – The names of the parts to process.

  • rerun (bool) – Whether the step is cleaned before execution.

Return type:

list[Action]

Returns:

The list of actions that should be executed.

reload_state()[source]

Reload state from persistent storage.

Return type:

None