Skip to content

Commit

Permalink
Use Makefile to get around SAM issue
Browse files Browse the repository at this point in the history
  • Loading branch information
symroe committed Nov 30, 2024
1 parent 5e832b2 commit 9b8efaf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lambda-layers/DependenciesLayer:
mkdir -p $@

lambda-layers/DependenciesLayer/requirements.txt: pyproject.toml uv.lock lambda-layers/DependenciesLayer lambda-layers/DependenciesLayer ## Update the requirements.txt file used to build this Lambda function's DependenciesLayer
uv export --no-hashes --no-editable --no-dev | sed "s/ @ /@/" > lambda-layers/DependenciesLayer/requirements.txt
uv export --no-hashes --no-editable --no-dev > lambda-layers/DependenciesLayer/requirements.txt

thumbs/requirements.txt: thumbs/pyproject.toml uv.lock ## Update the requirements.txt file used to build this Lambda function's DependenciesLayer
uv export --no-hashes --project thumbs > thumbs/requirements.txt
Expand Down
4 changes: 4 additions & 0 deletions lambda-layers/DependenciesLayer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

build-DependenciesLayer:
pip install --break-system-packages setuptools
pip install --upgrade -r requirements.txt --target "$(ARTIFACTS_DIR)/python/"
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"dc-design-system",
"dc-django-utils",
"dj-pagination==2.4.0",
Expand All @@ -29,6 +28,7 @@ dependencies = [
"psycopg2-binary==2.9.10",
"sorl-thumbnail===12.11.0",
"setuptools>=75.6.0",
"aws-wsgi",
]

[tool.uv.workspace]
Expand All @@ -38,7 +38,7 @@ members = ["thumbs"]
django-uk-political-parties = { git = "https://github.com/DemocracyClub/django-uk-political-parties.git", rev = "86ffa51f8306858c379c9de5be2f4bdb24b3a910" }
dc-design-system = { git = "https://github.com/DemocracyClub/design-system.git", rev = "c5c5de6b792b4b57997b65370fdcdfa4f099cdf4" }
dc-django-utils = { git = "https://github.com/DemocracyClub/dc_django_utils.git", rev = "7.0.1" }
aws-wsgi = { git = "https://github.com/DemocracyClub/awsgi.git", rev = "master" }
aws-wsgi = { git = "https://github.com/DemocracyClub/awsgi.git" }

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "electionleaflets.settings.testing"
Expand All @@ -59,6 +59,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",
Expand Down
2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Resources:
CompatibleRuntimes:
- python3.12
Metadata:
BuildMethod: python3.12
BuildMethod: makefile


ElectionLeafletsFunction:
Expand Down
11 changes: 9 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b8efaf

Please sign in to comment.