From 3408718084b56e1253addcab258c5fc0e8844f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A4ntz=20Miccoli?= Date: Fri, 21 Jun 2019 18:24:52 +0200 Subject: [PATCH 1/2] Force the creation of a python3 virtualenv --- awscli-lambda-package_macos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awscli-lambda-package_macos.sh b/awscli-lambda-package_macos.sh index b166d81..e19116b 100755 --- a/awscli-lambda-package_macos.sh +++ b/awscli-lambda-package_macos.sh @@ -17,7 +17,7 @@ export ZIP_FILE_NAME="awscli-lambda-layer.zip" mkdir ${VIRTUAL_ENV_DIR} # Initializes a virtual environment in the virtual environment directory -virtualenv ${VIRTUAL_ENV_DIR} +virtualenv -p python3 ${VIRTUAL_ENV_DIR} # Changes current dir to the virtual env directory cd ${VIRTUAL_ENV_DIR}/bin/ @@ -56,4 +56,4 @@ cd .. # Removes virtual env and temp directories rm -r ${VIRTUAL_ENV_DIR} -rm -r ${LAMBDA_LAYER_DIR} \ No newline at end of file +rm -r ${LAMBDA_LAYER_DIR} From 99eb37ae8be7b3bd6e20183248feb6a5aa3f95bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A4ntz=20Miccoli?= Date: Sat, 22 Oct 2022 17:46:39 +0200 Subject: [PATCH 2/2] Work with any python version --- awscli-lambda-package_macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awscli-lambda-package_macos.sh b/awscli-lambda-package_macos.sh index e19116b..86fab85 100755 --- a/awscli-lambda-package_macos.sh +++ b/awscli-lambda-package_macos.sh @@ -46,7 +46,7 @@ cd ${LAMBDA_LAYER_DIR} # Copies aws and its dependencies to the temp directory cp ../${VIRTUAL_ENV_DIR}/bin/aws . -cp -r ../${VIRTUAL_ENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/ . +cp -r ../${VIRTUAL_ENV_DIR}/lib/python*/site-packages/ . # Zips the contents of the temporary directory zip -r ../${ZIP_FILE_NAME} *