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_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

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

model_fields: ClassVar[Dict[str, FieldInfo]] = {'plugin': FieldInfo(annotation=Literal['poetry'], required=False, default='poetry', alias='plugin', alias_priority=1), 'poetry_with': FieldInfo(annotation=set[str], required=False, default_factory=set, alias='poetry-with', alias_priority=1, title='Optional dependency groups', description='optional dependency groups to include when installing.'), 'source': FieldInfo(annotation=str, required=True, alias='source', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

plugin: Literal['poetry']
poetry_with: set[str]
source: str