From 927c670fa050eb35d845f8f3b73d2cc03e1c36a6 Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Sat, 30 Nov 2024 08:56:00 +0000 Subject: [PATCH] Use Makefile to get around SAM issue https://github.com/aws/aws-lambda-builders/issues/675 --- lambda-layers/DependenciesLayer/Makefile | 4 ++++ pyproject.toml | 2 +- template.yaml | 2 +- uv.lock | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 lambda-layers/DependenciesLayer/Makefile diff --git a/lambda-layers/DependenciesLayer/Makefile b/lambda-layers/DependenciesLayer/Makefile new file mode 100644 index 00000000..c61905d3 --- /dev/null +++ b/lambda-layers/DependenciesLayer/Makefile @@ -0,0 +1,4 @@ + +build-DependenciesLayer: + pip install --break-system-packages setuptools + pip install --upgrade -r requirements.txt --target "$(ARTIFACTS_DIR)/python/" diff --git a/pyproject.toml b/pyproject.toml index c8e647d7..0e3b1b8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,6 @@ description = " 📮 A Django port of the original PHP code from electionleaflet readme = "README.md" requires-python = ">=3.12" dependencies = [ - "aws-sam-cli==1.131.0", "aws-wsgi", "dc-design-system", "dc-django-utils", @@ -62,6 +61,7 @@ lint.extend-select = [ [dependency-groups] dev = [ + "aws-sam-cli==1.131.0", "pytest==8.3.3", "pytest-cov==6.0.0", "pytest-django==4.9.0", diff --git a/template.yaml b/template.yaml index 6c20d7be..572f3772 100644 --- a/template.yaml +++ b/template.yaml @@ -86,7 +86,7 @@ Resources: CompatibleRuntimes: - python3.12 Metadata: - BuildMethod: python3.12 + BuildMethod: makefile ElectionLeafletsFunction: diff --git a/uv.lock b/uv.lock index d782d186..0b1e3d25 100644 --- a/uv.lock +++ b/uv.lock @@ -734,7 +734,6 @@ name = "electionleaflets" version = "0.1.0" source = { virtual = "." } dependencies = [ - { name = "aws-sam-cli" }, { name = "aws-wsgi" }, { name = "dc-design-system" }, { name = "dc-django-utils" }, @@ -770,6 +769,7 @@ deploy = [ ] dev = [ { name = "aloe-django" }, + { name = "aws-sam-cli" }, { name = "django-debug-toolbar" }, { name = "moto" }, { name = "pytest" }, @@ -781,7 +781,6 @@ dev = [ [package.metadata] requires-dist = [ - { name = "aws-sam-cli", specifier = "==1.131.0" }, { name = "aws-wsgi", git = "https://github.com/DemocracyClub/awsgi.git?rev=b286f129c5580547577f942c75be74cdca707386" }, { name = "dc-design-system", git = "https://github.com/DemocracyClub/design-system.git?rev=c5c5de6b792b4b57997b65370fdcdfa4f099cdf4" }, { name = "dc-django-utils", git = "https://github.com/DemocracyClub/dc_django_utils.git?rev=7.0.1" }, @@ -817,6 +816,7 @@ deploy = [ ] dev = [ { name = "aloe-django", specifier = "==0.2.0" }, + { name = "aws-sam-cli", specifier = "==1.131.0" }, { name = "django-debug-toolbar", specifier = "==5.0.0a0" }, { name = "moto", specifier = "==5.0.21" }, { name = "pytest", specifier = "==8.3.3" },