From 7f6a3deedf97ae3ed5002137e3f0cd0d3027a05f 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 3e74cb5c..b0dc860c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,6 @@ description = "An online archive of political leaflets" readme = "README.md" requires-python = ">=3.12" dependencies = [ - "aws-sam-cli==1.131.0", "aws-wsgi", "dc-design-system @ https://github.com/DemocracyClub/design-system/archive/refs/tags/0.6.0.zip", "dc-django-utils @ git+https://github.com/DemocracyClub/dc_django_utils.git@7.0.1", @@ -61,6 +60,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 ca0dac3a..cf460718 100644 --- a/uv.lock +++ b/uv.lock @@ -735,7 +735,6 @@ name = "electionleaflets" version = "0.0.0" source = { virtual = "." } dependencies = [ - { name = "aws-sam-cli" }, { name = "aws-wsgi" }, { name = "dc-design-system" }, { name = "dc-django-utils" }, @@ -771,6 +770,7 @@ deploy = [ ] dev = [ { name = "aloe-django" }, + { name = "aws-sam-cli" }, { name = "django-debug-toolbar" }, { name = "moto" }, { name = "pytest" }, @@ -782,7 +782,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", url = "https://github.com/DemocracyClub/design-system/archive/refs/tags/0.6.0.zip" }, { name = "dc-django-utils", git = "https://github.com/DemocracyClub/dc_django_utils.git?rev=7.0.1" }, @@ -818,6 +817,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" },