poetry_builder

Poetry-based Lambda layer builder implementation.

This module provides Lambda layer creation using Poetry’s dependency management, supporting both local and containerized builds. Poetry offers reproducible builds through lock files and sophisticated dependency resolution.

Command Pattern Classes:

class aws_lambda_artifact_builder.layer.poetry_builder.PoetryBasedLambdaLayerLocalBuilder(verbose: bool = True, printer: ~typing.Callable[[str], None] = <built-in function print>, path_pyproject_toml: ~pathlib.Path = REQ, credentials: ~aws_lambda_artifact_builder.layer.foundation.Credentials | None = None, skip_prompt: bool = False, _build_tool: str = LayerBuildToolEnum.poetry, path_bin_poetry: ~pathlib.Path = REQ)[source]

This class implements Poetry-specific build workflow using virtual environments and lock file-based dependency resolution.

Key Features:

  • Lock file-based reproducible builds

  • Environment variable authentication (POETRY_HTTP_BASIC_*)

  • In-project virtual environment setup

  • No root package installation (–no-root)

step_1_1_print_info()[source]

Display Poetry-specific build information.

step_2_prepare_environment()[source]

Set up necessary prerequisites for the build process.

step_2_2_prepare_poetry_stuff()[source]

Copy Poetry project files to build directory.

Copies pyproject.toml and poetry.lock to ensure reproducible builds with exact dependency versions as resolved in development.

step_3_execute_build()[source]

Perform Poetry-based Lambda layer build step.

step_3_1_poetry_login()[source]

Configure Poetry authentication via environment variables.

step_3_2_run_poetry_install()[source]

Execute Poetry installation with lock file constraints.

Runs Poetry install with –no-root to exclude the project package itself, installing only dependencies into an in-project virtual environment.

class aws_lambda_artifact_builder.layer.poetry_builder.PoetryBasedLambdaLayerContainerBuilder(verbose: bool = True, printer: ~typing.Callable[[str], None] = <built-in function print>, path_pyproject_toml: ~pathlib.Path = REQ, py_ver_major: int = REQ, py_ver_minor: int = REQ, is_arm: bool = REQ, path_script: ~pathlib.Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/aws-lambda-artifact-builder/envs/stable/lib/python3.11/site-packages/aws_lambda_artifact_builder/layer/_build_lambda_layer_using_poetry_in_container.py'), credentials: ~aws_lambda_artifact_builder.layer.foundation.Credentials | None = None)[source]

Command class for containerized Poetry-based Lambda layer builds.

step_1_preflight_check()[source]

Validate Docker environment and container build prerequisites.