-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
62 lines (44 loc) · 1.43 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SHELL=/bin/bash
SHELLOPTS=errexit:pipefail
ENVDIR=env
ACTIVATE:=$(ENVDIR)/bin/activate
.PHONY: clean
count=10
PYTHON_EXECUTABLE=python3
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
VIRTUALENV_EXECUTABLE=pyvenv
endif
ifeq ($(UNAME_S), Darwin)
VIRTUALENV_EXECUTABLE=pyvenv
endif
CONF=../conf/dev.py
requirements = requirements.txt requirements-dev.txt
virtualenv: $(ACTIVATE)
$(ACTIVATE): $(requirements)
test -d $(ENVDIR) || $(VIRTUALENV_EXECUTABLE) $(ENVDIR)
for f in $?; do \
. $(ACTIVATE); pip install -U -r $$f; \
done
touch $(ACTIVATE)
dev: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" $(PYTHON_EXECUTABLE) runserver.py
test: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" py.test --cov colombia tests/
shell: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" $(PYTHON_EXECUTABLE) manage.py shell
dummy: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" $(PYTHON_EXECUTABLE) manage.py dummy -n $(count)
import: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" PYTHONPATH=. $(PYTHON_EXECUTABLE) colombia/import.py
downloads: virtualenv
. $(ACTIVATE); FLASK_CONFIG="$(CONF)" PYTHONPATH=. $(PYTHON_EXECUTABLE) colombia/downloads.py
submodule:
test -d doc/_themes/ || git submodule add git://github.com/kennethreitz/kr-sphinx-themes.git doc/_themes
docs: virtualenv submodule
git submodule update --init
. $(ACTIVATE); make -C doc/ html
open doc/_build/html/index.html
clean:
rm -rf $(ENVDIR)
rm -rf doc/_build/