From 163ae76b1c58c1cb80d8fe101014f50ebba4ccc1 Mon Sep 17 00:00:00 2001 From: bick4ord Date: Tue, 15 Aug 2023 13:50:29 -0400 Subject: [PATCH] fix lambda packaging (#12) * remove a step from the lambda zip cleanup that was mangling filenames * add explicit architecture params to lambda package so running the script from an arm macbook will still work when targeting an amd64 lambda * update changelog --- CHANGES.md | 5 +++++ build-lambda.sh | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ceb36d82e..9aa9bb594 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Release Notes +## 0.12.0-1.0.0 (2023-08-15) + +* introduce new split versioning scheme that represents the upstream titiler version (v0.12.0) and the mosaic version (1.0.0) +* fix broken packaging in lambda zip file introduced from upgrading to python 3.10 + ## 0.12.0 (2023-07-17) * use `Annotated` Type for Query/Path parameters diff --git a/build-lambda.sh b/build-lambda.sh index 350c27e45..e637d94e3 100755 --- a/build-lambda.sh +++ b/build-lambda.sh @@ -13,7 +13,11 @@ pip install --upgrade pip # https://github.com/aws/aws-sam-cli/issues/3661#issuecomment-1044340547 python -m pip install \ - --no-cache-dir --upgrade \ + --no-cache-dir \ + --platform manylinux2014_x86_64 \ + --implementation cp \ + --only-binary=:all: \ + --upgrade \ --target=./lambda/ \ ./src/titiler/core \ ./src/titiler/extensions["cogeo,stac"] \ @@ -29,9 +33,8 @@ python -m pip install \ cd lambda echo "cleaning up..." -find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[2-3][0-9]//'); cp $f $n; done; +find . -type d -a -name '*.dist-info' -print0 | xargs -0 rm -rf find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf -find . -type f -a -name '*.py' -print0 | xargs -0 rm -f find . -type d -a -name 'tests' -print0 | xargs -0 rm -rf echo "copying handler..."