craft_parts.actions module¶
Definitions of lifecycle actions and action types.
- class craft_parts.actions.Action(part_name, step, action_type=ActionType.RUN, reason=None, project_vars=<factory>, properties=ActionProperties(changed_files=None, changed_dirs=None))[source]¶
Bases:
objectThe action to be executed for a given part.
Actions correspond to the operations required to run the lifecycle for each of the parts in the project specification.
- Parameters:
part_name (
str) – The name of the part this action will be performed on.step (
Step) – TheStepthis action will execute.action_type (
ActionType) – Action to run for this step.reason (
str|None) – A textual description of why this action should be executed.project_vars (
ProjectVarInfo) – The values of project variables from a previous execution, used if the action type isActionType.SKIP.properties (
ActionProperties)
-
action_type:
ActionType= 0¶
-
part_name:
str¶
-
project_vars:
ProjectVarInfo¶
-
properties:
ActionProperties= ActionProperties(changed_files=None, changed_dirs=None)¶
-
reason:
str|None= None¶
- class craft_parts.actions.ActionProperties(changed_files=None, changed_dirs=None)[source]¶
Bases:
objectProperties defined for an action.
- Parameters:
changed_files (
list[str] |None)changed_dirs (
list[str] |None)
-
changed_dirs:
list[str] |None= None¶
-
changed_files:
list[str] |None= None¶
- class craft_parts.actions.ActionType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnumThe type of action to be executed.
Action execution can be modified according to its type:
RUN: execute the expected commands for step processing.RERUN: clear the existing data and state before proceeding.UPDATE: try to continue processing the step.SKIP: don’t execute this action.REAPPLY: run the step commands without updating its state.- REAPPLY = 4¶
- RERUN = 1¶
- RUN = 0¶
- SKIP = 2¶
- UPDATE = 3¶