Last active
October 28, 2017 16:46
-
-
Save cedricvidal/e3ec9af0ad5babc1391e6685b6c4fb1c to your computer and use it in GitHub Desktop.
Python direnv setup
This file contains hidden or 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
#!/usr/bin/env bash | |
REQS_MD5=$(md5 -q requirements.txt $(cat requirements.txt | grep "^-r " | cut -d " " -f 2)) | |
if [ ! -f .direnv/reqs_md5 ] || [ "$(cat .direnv/reqs_md5)" != "${REQS_MD5}" ]; then | |
echo "Installing python requirements" | |
pip3 install -r requirements.txt | |
mkdir -p .direnv | |
echo ${REQS_MD5} > .direnv/reqs_md5 | |
else | |
echo "Python requirements up to date" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment