Skip to main content

uv-python-lambda

CDK Construct for Python Lambda Functions using uv

Goals

  • ⚡️ Package and deploy Lambda Functions faster with uv's speed
  • 📦 Support workspaces in a monorepo with uv workspaces

uv-python-lambda is based on aws-lambda-python-alpha with some differences:

  • It only supports uv for packaging - there is no Poetry or pip support
  • It supports workspaces so you can build multiple Lambda functions from different uv workspaces and have their dependencies included correctly. This is useful for, but not limited to, monorepos.

API

See API.md

Example

from uv_python_lambda import PythonFunction
from constructs import Construct

# The root path should be relative to your CDK source file
root_path = Path(__file__).parent.parent.parent


class CdkStack(Stack):
    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        fn = PythonFunction(
          self,
          "fn",
          root_dir=str(root_path),
          index="fetcher_lambda.py",
          workspace_package="fetcher",  # Use a workspace package as the top-level Lambda entry point.
          handler="handle_event",
          bundling={
              "asset_excludes": [
                  ".venv/",
                  "node_modules/",
                  "cdk/",
                  ".git/",
                  ".idea/",
                  "dist/",
              ]
          },
          timeout=Duration.seconds(30),
        )

Release files for uv-python-lambda 0.0.7

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

Source distribution (sdist)

Source distribution for uv-python-lambda 0.0.7
File Size Uploaded
uv_python_lambda-0.0.7.tar.gz 79.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uv-python-lambda 0.0.7
File Interpreter ABI Platform
uv_python_lambda-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 157.9 kB

Release files / uv_python_lambda-0.0.7.tar.gz

Download URL uv_python_lambda-0.0.7.tar.gz
Size 79.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e55e345b3b82b535dccee29dfdbc55f838f0c5fe55fc38ea3857b5b7870d4773
BLAKE2b-256 checksum
How to use checksums
fd57669f5f675e03668af90d35c0f637a88fb6e377e890f54bb5d67bd3d2835a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / uv_python_lambda-0.0.7-py3-none-any.whl

Download URL uv_python_lambda-0.0.7-py3-none-any.whl
Size 78.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
165e9719421e359563b10f67e31a00a5e35caca4ada38e4b389eda610f1b9587
BLAKE2b-256 checksum
How to use checksums
da48fc5f52e77b041be3eab0ad5026504ebcee66009ee9b7c26429f9575e7dcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

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