Obsoleted by: https://docs.astral.sh/uv/guides/integration/aws-lambda/
This python demo project is managed by uv - the next gen python package and project manager.
The trick to make this work, is to copy the files/directories from
.venv/lib/python${PYTHON_VERSION}/site-packages/
to /var/task/
flat.
Also you must specify --no-editable
in uv sync
so that the project is not symlinked.
Project created with uv init --app --package
, which uses the
src/
layout
(which I prefer anyway).
podman build -t demo-uv-aws-lambda .
podman run --rm -p 9000:8080 demo-uv-aws-lambda
In another terminal/shell
curl "http://localhost:9000/2015-03-31/functions/function/invocations" \
-d '{"payload":"hello world!"}'