Skip to main content

uv-python-lambda

Project description

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),
        )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_python_lambda-0.0.3.tar.gz (78.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_python_lambda-0.0.3-py3-none-any.whl (77.8 kB view details)

Uploaded Python 3

File details

Details for the file uv_python_lambda-0.0.3.tar.gz.

File metadata

  • Download URL: uv_python_lambda-0.0.3.tar.gz
  • Upload date:
  • Size: 78.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for uv_python_lambda-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ff6fc2395ac5ddf287660d527e17b3c72b6f9eac34088d80cb458b0eb9b864c3
MD5 ce0e1f3f3b0a38aa2cba15a7d1959c76
BLAKE2b-256 d9e28c8803bc5dee6ae0ce308c20979daf237b83eea9d4d41c1a0b269390ff85

See more details on using hashes here.

File details

Details for the file uv_python_lambda-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for uv_python_lambda-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11b04ee0c72b015f693dcd7be5d817acfb1b6eca43f0aaedfa5479462c19b0d3
MD5 fc1e5f4c7fe36fa446e73cfbdaaf0088
BLAKE2b-256 ad5170ddbc4762b03d4342dde9f2425969b33a1b5b02bfef785ccacc43ca54c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page