Skip to content

Instantly share code, notes, and snippets.

@cedricvidal
Last active October 28, 2017 16:46
Show Gist options
  • Save cedricvidal/e3ec9af0ad5babc1391e6685b6c4fb1c to your computer and use it in GitHub Desktop.
Save cedricvidal/e3ec9af0ad5babc1391e6685b6c4fb1c to your computer and use it in GitHub Desktop.
Python direnv setup
#!/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