craft_parts.plugins.properties module

Definitions and helpers for plugin options.

class craft_parts.plugins.properties.PluginProperties(**data)[source]

Bases: BaseModel

Options specific to a plugin.

PluginProperties should be subclassed into plugin-specific property classes and populated from a dictionary containing part properties.

By default all plugin properties will be compared to check if the build step is dirty. This can be overridden in each plugin if needed.

Parameters:

data (Any)

classmethod get_build_properties()[source]

Obtain the list of properties affecting the build stage.

Return type:

list[str]

classmethod get_pull_properties()[source]

Obtain the list of properties affecting the pull stage.

Return type:

list[str]

marshal()[source]

Obtain a dictionary containing the plugin properties.

Return type:

dict[str, Any]

model_config: ClassVar[ConfigDict] = {'alias_generator': <function PluginProperties.<lambda>>, 'extra': 'forbid', 'frozen': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod model_properties(cls)[source]

Get the properties for this model from the JSON schema.

Return type:

dict[str, dict[str, Any]]

plugin: str
source: str | None
classmethod unmarshal(data)[source]

Populate class attributes from the part specification.

Parameters:

data (dict[str, Any]) – A dictionary containing part properties.

Return type:

Self

Returns:

The populated plugin properties data object.