-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
29 lines (24 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.PHONY: env __env req test
env:
@if [ "`pwd`/env/bin/python" = "`which python`" ]; then echo '>>> Already in virtualenv'; else make __env; fi
__env:
@which pip &> /dev/null || sudo easy_install pip
@which virtualenv &> /dev/null || sudo pip install virtualenv
@ls ./env &> /dev/null || mkdir ./env
@ls ./env/bin &> /dev/null || virtualenv ./env
@echo 'export DIR="`pwd`"; \
ls ~/.zshrc &> /dev/null && source ~/.zshrc; \
cd $${DIR}; \
echo ">>> Now entering Python virtualenv"; \
source ./env/bin/activate; \
echo -en ">>> python is now "; \
which python' > ./env/bin/.zshrc
@if which zsh &> /dev/null; then ZDOTDIR=./env/bin zsh; \
echo ">>> Now exiting Python virtualenv"; \
else bash --rcfile ./env/bin/.zshrc; fi
req:
@if [ "`pwd`/env/bin/python" != "`which python`" ]; then echo 'Not in virtualenv'; \
else pip install -r requirements.txt; fi
test:
@if [ "`pwd`/env/bin/python" != "`which python`" ]; then echo 'Not in virtualenv'; \
else nosetests --nocapture --exe; fi