commit bf899e11dc0d52cf1e3c1f056a6400b58fcb3e37 parent ee4c99ad9e3deafe1cf86c7e1eefcb2f03346047 Author: Daniel Moch <daniel@danielmoch.com> Date: Sun, 12 Aug 2018 14:33:57 -0400 Create virtualenv for python checkouts Diffstat:
M | .cvsignore | | | 1 | + |
M | .local/lib/gitdir/hooks/post-checkout | | | 18 | ++++++++++++++++++ |
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/.cvsignore b/.cvsignore @@ -23,3 +23,4 @@ TAGS *.vdi *.vmdk *.vhd +.env/ diff --git a/.local/lib/gitdir/hooks/post-checkout b/.local/lib/gitdir/hooks/post-checkout @@ -1,2 +1,20 @@ #!/bin/sh +if [ -f setup.py ] +then + [ -d .env ] && rm -rf .env + echo "(Re)creating a virtual environment" + virtualenv .env + source .env/bin/activate + for req in `ls requirements*.txt` + do + echo -n "Installing requirements listed in $req ... " + pip install -r $req > /dev/null 2>&1 + if [ $? -eq 0 ] + then + echo "Done" + else + echo "Complete with errors" + fi + done +fi `git rev-parse --git-dir`/hooks/ctags >/dev/null 2>&1 &