uv_builder

UV-based Lambda layer builder implementation.

This module provides Lambda layer creation using UV’s ultra-fast dependency management, supporting both local and containerized builds. UV offers the fastest dependency resolution and installation while maintaining compatibility with pip and Poetry workflows.

Command Pattern Classes:

  • UvBasedLambdaLayerLocalBuilder: Local uv-based builds

  • UvBasedLambdaLayerContainerBuilder: Containerized uv-based builds

class aws_lambda_artifact_builder.layer.uv_builder.UVBasedLambdaLayerLocalBuilder(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.uv, path_bin_uv: ~pathlib.Path = REQ)[source]

This class implements UV-specific build workflow using lock files and UV’s high-performance dependency resolution.

Key Features:

  • Frozen lock file installation (–frozen)

  • Environment variable authentication (UV_INDEX_*)

  • Development dependency exclusion (–no-dev)

  • Copy-based linking for Lambda compatibility (–link-mode=copy)

step_1_1_print_info()[source]

Display uv-specific build information.

step_2_prepare_environment()[source]

Set up necessary prerequisites for the build process.

step_2_2_prepare_uv_stuff()[source]

Copy UV project files to build directory.

Copies pyproject.toml and uv.lock to ensure reproducible builds with exact dependency versions as resolved by UV.

step_3_execute_build()[source]

Perform Poetry-based Lambda layer build step.

step_3_1_uv_login()[source]

Configure UV authentication via environment variables.

step_3_2_run_uv_sync()[source]

Execute UV sync with lock file constraints.

Runs UV sync with –frozen to prevent lock file updates, –no-dev to exclude development dependencies, and –no-install-project to exclude the project itself. Uses –link-mode=copy for Lambda layer compatibility.

class aws_lambda_artifact_builder.layer.uv_builder.UVBasedLambdaLayerContainerBuilder(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_uv_in_container.py'), credentials: ~aws_lambda_artifact_builder.layer.foundation.Credentials | None = None)[source]

Command class for containerized UV-based Lambda layer builds.

step_1_preflight_check()[source]

Validate Docker environment and container build prerequisites.