craft_parts.plugins.poetry_plugin module

The poetry plugin.

class craft_parts.plugins.poetry_plugin.PoetryPlugin(*, properties, part_info)[source]

Bases: BasePythonPlugin

A plugin to build python parts.

Parameters:
get_build_packages()[source]

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

Return type:

set[str]

properties_class

alias of PoetryPluginProperties

validator_class

alias of PoetryPluginEnvironmentValidator

class craft_parts.plugins.poetry_plugin.PoetryPluginEnvironmentValidator(*, part_name, env, properties)[source]

Bases: PluginEnvironmentValidator

Check the execution environment for the Poetry plugin.

Parameters:
  • part_name (str) – The part whose build environment is being validated.

  • env (str) – A string containing the build step environment setup.

  • properties (PluginProperties)

validate_environment(*, part_dependencies=None)[source]

Ensure the environment has the dependencies to build Poetry applications.

Parameters:

part_dependencies (Optional[list[str]]) – A list of the parts this part depends on.

Return type:

None

class craft_parts.plugins.poetry_plugin.PoetryPluginProperties(**data)[source]

Bases: PluginProperties

The part properties used by the poetry plugin.

Parameters:

data (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].

plugin: Literal['poetry']
poetry_export_extra_args: list[str]
poetry_pip_extra_args: list[str]
poetry_with: set[str]
source: str