-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (45 loc) · 1.59 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
VENV_TMP_DIR = '.tmpvenv'
VENV_DIR = 'venv-tnb'
PYTHON = 'python3.5'
############################
# Help
############################
help:
@echo "usage: make <command>"
@echo
@echo " srv-install-dev to install the server in development mode"
@echo " srv-install to install the server in production mode"
@echo " compile to compile the frontend assets"
srv-install-dev:
@echo ""
@test -d $(VENV_TMP_DIR) || virtualenv --python $(PYTHON) $(VENV_TMP_DIR)
@. $(VENV_TMP_DIR)/bin/activate \
&& pip install -U pip \
&& pip install -U virtualenv \
&& { test -d $(VENV_DIR) || virtualenv --always-copy --python $(PYTHON) $(VENV_DIR); } \
&& $(VENV_DIR)/bin/pip install -U pip \
&& $(VENV_DIR)/bin/pip install -U -e . \
&& $(VENV_DIR)/bin/pip install -r py-requirements/dev.txt -r py-requirements/test.txt
@echo "Done!"
frontend-install-dev:
npm install
install-dev: srv-install-dev frontend-install-dev
test-srv:
@$(VENV_DIR)/bin/coverage run --source src/python/trust_network_backend/tnb $(VENV_DIR)/bin/py.test tests/python; \
echo "Coverage report for python tests: "; \
$(VENV_DIR)/bin/coverage report |grep -v '\-\-\-\-\-\-\-\-'|grep -v 'src/python' \
|sed 's/Name/ /g' ; \
$(VENV_DIR)/bin/coverage html ; \
echo "Coverage report is done. Run 'chromium-browser htmlcov/index.html' to view it"
test-client:
npm test
clean:
rm -rf $(VENV_TMP_DIR)
rm -rf $(VENV_DIR)
rm -rf dist
find . -name trust_network_backend.egg-info |xargs -I this rm -rf this
find . -name __pycache__ |xargs -I this rm -rf this
serve:
$(VENV_DIR)/bin/tnb_serve
compile:
npm run compile