Skip to main content
Documentation Status https://github.com/MacHu-GWU/aws_lbd_art_builder_uv-project/actions/workflows/main.yml/badge.svg https://codecov.io/gh/MacHu-GWU/aws_lbd_art_builder_uv-project/branch/main/graph/badge.svg https://img.shields.io/pypi/v/aws-lbd-art-builder-uv.svg https://img.shields.io/pypi/l/aws-lbd-art-builder-uv.svg https://img.shields.io/pypi/pyversions/aws-lbd-art-builder-uv.svg https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to aws_lbd_art_builder_uv Documentation

https://aws-lbd-art-builder-uv.readthedocs.io/en/latest/_static/aws_lbd_art_builder_uv-logo.png

aws_lbd_art_builder_uv is the uv builder for aws_lbd_art_builder_core: it turns a project’s pyproject.toml and uv.lock into the python/ folder of an AWS Lambda layer, using uv.

It offers two builders:

  • UvLambdaLayerLocalBuilder: runs uv sync on the host. Fast, no Docker. Best for pure-Python dependencies.

  • UvLambdaLayerContainerBuilder: runs uv sync inside an AWS SAM build image, so packages with C extensions (numpy, pydantic-core, …) get Linux binaries for the target Python and architecture.

Both run four steps (Preflight Check → Prepare Environment → Execute Build → Finalize Artifacts) and leave the layer content in build/lambda/layer/artifacts/python/. Zipping, uploading, and publishing the layer come from aws_lbd_art_builder_core, re-exported here.

Features:

  • Reproducible builds: uv sync --frozen from the lock file, project itself never installed.

  • UvSyncOptions picks what goes into the layer: extras, dependency groups, and any other uv sync flag, checked when the object is built.

  • Private package indexes (e.g. AWS CodeArtifact) through Credentials.

  • validate_artifacts checks that every dependency landed in the layer, and optionally that its wheels target Linux.

Quick Look

Build a layer in a container, check it, then zip, upload, and publish it:

from pathlib import Path

import boto3
from s3pathlib.api import S3Path
import aws_lbd_art_builder_uv.api as aws_lbd_art_builder_uv

layer_api = aws_lbd_art_builder_uv.layer_api
path_pyproject_toml = Path("/path/to/my_app-project/pyproject.toml")

builder = layer_api.UvLambdaLayerContainerBuilder(
    path_pyproject_toml=path_pyproject_toml,
    py_ver_major=3,
    py_ver_minor=12,
    is_arm=False,
    skip_prompt=True,
    uv_sync_options=layer_api.UvSyncOptions(extras=["aws"]),
)
builder.run()
layer_api.validate_artifacts(
    dir_python=builder.path_layout.dir_python,
    path_pyproject_toml=path_pyproject_toml,
    check_linux=True,
    extras=["aws"],
)

boto_ses = boto3.Session()
s3dir_lambda = S3Path("s3://my-bucket/projects/my_app/lambda/")
layer_api.create_layer_zip_file(
    dir_python=builder.path_layout.dir_python,
    path_layer_zip=builder.path_layout.path_build_lambda_layer_zip,
)
layer_api.upload_layer_zip_to_s3(
    s3_client=boto_ses.client("s3"),
    path_pyproject_toml=path_pyproject_toml,
    s3dir_lambda=s3dir_lambda,
    path_manifest=path_pyproject_toml.parent / "uv.lock",
)
deployment = layer_api.LambdaLayerVersionPublisher(
    path_pyproject_toml=path_pyproject_toml,
    s3dir_lambda=s3dir_lambda,
    path_manifest=path_pyproject_toml.parent / "uv.lock",
    s3_client=boto_ses.client("s3"),
    layer_name="my_app",
    lambda_client=boto_ses.client("lambda"),
).run()  # raises ValueError if uv.lock is unchanged since the last version
print(deployment.layer_version_arn)

Pass plain boto3 clients. S3 locations are s3pathlib 3.x S3Path objects. The project needs a .venv with the same Python minor version as the build (uv venv --python 3.12). Core’s LayerDeploymentWorkflow runs the same steps in one call with either builder.

Install

aws_lbd_art_builder_uv is released on PyPI and supports Python 3.11 to 3.14. It needs uv on PATH, and Docker for container builds. The base install builds and validates layers; uploading and publishing need an extra:

$ pip install aws-lbd-art-builder-uv                  # build and validate
$ pip install "aws-lbd-art-builder-uv[upload]"        # + S3 upload (boto3, s3pathlib 3.x)
$ pip install "aws-lbd-art-builder-uv[publish]"       # + publish Lambda layer versions

To upgrade to latest version:

$ pip install --upgrade "aws-lbd-art-builder-uv[publish]"

Upgrading from 0.x: 1.0.0 requires aws_lbd_art_builder_core 1.x, which moved to s3pathlib 3.x and no longer accepts a BotoSesManager as s3_client; see the release history.

Metadata

Release files for aws_lbd_art_builder_uv 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws_lbd_art_builder_uv 1.0.0
File Size Uploaded
aws_lbd_art_builder_uv-1.0.0.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aws_lbd_art_builder_uv 1.0.0
File Interpreter ABI Platform
aws_lbd_art_builder_uv-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.5 kB

Release files / aws_lbd_art_builder_uv-1.0.0.tar.gz

Download URL aws_lbd_art_builder_uv-1.0.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e3130205da9f8b28ac8347e8a645346d3def4a75a391e1edc250d3f82dd9ad41
BLAKE2b-256 checksum
How to use checksums
2b833f3fa54767fcbe2ccd359caf3037b93e9c951f076f0c7b802a69236669b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / aws_lbd_art_builder_uv-1.0.0-py3-none-any.whl

Download URL aws_lbd_art_builder_uv-1.0.0-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3b58c42167975df563b7a44bf17fe764e150f280256d93501b17347e5480f43
BLAKE2b-256 checksum
How to use checksums
ea4a1d74e4fcb9f5ffc58d23887d9ac2f15ce6cc6f968a927d690c1aaeee7b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page