Skip to content

Instantly share code, notes, and snippets.

@bq1990
Created May 19, 2019 18:28
Show Gist options
  • Save bq1990/f71eebca84c279f84c33bdb315be2333 to your computer and use it in GitHub Desktop.
Save bq1990/f71eebca84c279f84c33bdb315be2333 to your computer and use it in GitHub Desktop.
Bundle Python requirements in zip file
#!/bin/bash
pip install -r requirements.txt --target ./packages
if [ -d packages ]; then
cd packages
find . -name "*.pyc" -delete
find . -name "*.egg-info" | xargs rm -rf
zip -9mrv packages.zip .
mv packages.zip ..
cd ..
rm -rf packages
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment