Created
October 12, 2023 02:09
-
-
Save AndreVallestero/622d58e36a1592a1e683857884d34953 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Expects two arguments: a pip package and a target directory. Installs the pip | |
# package and removes unnecessary build artifacts from the resulting package. | |
# | |
# See documentation on ./build-layers.sh for more information. | |
set -e | |
set -x | |
TARGET_DIR=$1 | |
pip install scikit-learn pandas -t $TARGET_DIR | |
find $TARGET_DIR -type f -name "*.so" | xargs -r strip | |
find $TARGET_DIR -type f -name "*.pyc" | xargs -r rm | |
find $TARGET_DIR -type d -name "__pycache__" | xargs -r rm -r | |
find $TARGET_DIR -type d -name "*.dist-info" | xargs -r rm -r | |
find $TARGET_DIR -type d -name "tests" | xargs -r rm -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment