Skip to content

Commit

Permalink
pin dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner committed May 31, 2024
1 parent c1edfc4 commit c45e7c9
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions build-lambda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,33 @@ python -m pip install \
./src/titiler/mosaic \
./src/titiler/application \
mangum==0.17.0 \
rasterio==1.3.8 \
morecantile==5.0.0 \
rio-tiler==6.2.1 \
cogeo-mosaic==7.0.0 \
rasterio==1.3.10 \
morecantile==5.3.0 \
rio-tiler==6.6.1 \
cogeo-mosaic==7.1.0 \
markupsafe==2.0.1 \
boto3==1.28.27 \
botocore==1.31.59
# pinning boto3 and botocore above even though we're going to remove them to
# prevent pulling in different transitive dependencies

cd lambda

echo "cleaning up..."
# 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 d -a -name 'tests' -print0 | xargs -0 rm -rf

# remove boto3 and botocore, because otherwise the lambda zip is too large
# after exploding
find . -type d -a -name 'boto3' -print0 | xargs -0 rm -rf
find . -type d -a -name 'botocore' -print0 | xargs -0 rm -rf

# remove cache and test files
find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
find . -type d -a -name 'tests' -print0 | xargs -0 rm -rf

# DON'T remove dist-info, because email-validator relies on it for loading
# its version
# find . -type d -a -name '*.dist-info' -print0 | xargs -0 rm -rf

echo "copying handler..."
cp ../deployment/aws/lambda/handler.py .

Expand Down

0 comments on commit c45e7c9

Please sign in to comment.