craft_parts.plugins.python_plugin module

The python plugin.

class craft_parts.plugins.python_plugin.PythonPlugin(*, properties, part_info)[source]

Bases: Plugin

A plugin to build python parts.

Parameters:
get_build_commands()[source]

Return a list of commands to run during the build step.

Return type:

List[str]

get_build_environment()[source]

Return a dictionary with the environment to use in the build step.

Return type:

Dict[str, str]

get_build_packages()[source]

Return a set of required packages to install in the build environment.

Return type:

Set[str]

get_build_snaps()[source]

Return a set of required snaps to install in the build environment.

Return type:

Set[str]

properties_class

alias of PythonPluginProperties

class craft_parts.plugins.python_plugin.PythonPluginProperties(**data)[source]

Bases: PluginProperties, PluginModel

The part properties used by the python plugin.

Parameters:

data (Any) –

python_constraints: List[str]
python_packages: List[str]
python_requirements: List[str]
source: str
classmethod unmarshal(data)[source]

Populate make properties from the part specification.

Parameters:

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

Return type:

PythonPluginProperties

Returns:

The populated plugin properties data object.

Raises:

pydantic.ValidationError – If validation fails.