craft_parts.plugins.python_plugin module¶
The python plugin.
- class craft_parts.plugins.python_plugin.PythonPlugin(*, properties, part_info)¶
Bases:
BasePythonPluginA plugin to build python parts.
- Parameters:
properties (
PluginProperties)part_info (
PartInfo)
- properties_class¶
alias of
PythonPluginProperties
- class craft_parts.plugins.python_plugin.PythonPluginProperties(**data)¶
Bases:
PluginPropertiesThe part properties used by the python 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].
-
python_packages:
list[str]¶ The dependencies to install from PyPI.
If needed,
pip,setuptoolsandwheelcan be upgraded here.
-
python_requirements:
list[str]¶ The paths to requirements files.
Use this key when dependencies must be installed from one or more explicit requirements files, such as
requirements.txt. The plugin doesn’t automatically select a requirements file from the source tree; each file must be listed here.A part doesn’t need this key when its dependencies are already declared by the project metadata used during package installation. For example, when the source contains a
setup.pyorpyproject.tomlfile, the plugin installs the project and pip resolves the dependencies declared by the package itself. That metadata may also come from configuration files such assetup.cfg.