-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mk
47 lines (36 loc) · 1.06 KB
/
common.mk
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
# common make vars and targets:
export CODE_ROOT = "backendcore"
export API_DIR = "$(CODE_ROOT)/api"
export COMMON_DIR = "$(CODE_ROOT)/common"
export DATA_DIR = "$(CODE_ROOT)/data"
export EMAIL_DIR = "$(CODE_ROOT)/emailer"
export ENV_DIR = "$(CODE_ROOT)/env"
export SEC_DIR = "$(CODE_ROOT)/security"
export TEMPL_DIR = "$(CODE_ROOT)/templates"
export USER_DIR = "$(CODE_ROOT)/users"
export PANDOC = pandoc
export PYLINT = flake8
export PYLINTFLAGS = --exclude=__main__.py
# make sure we test against local DB:
export LOCAL_MONGO=1
PYTHONFILES = $(shell ls *.py)
PYTESTFLAGS = -vv --verbose --cov-branch --cov-report term-missing --tb=short -W ignore::FutureWarning
MAIL_METHOD = api
FORCE:
tests: lint pytests
lint: $(patsubst %.py,%.pylint,$(PYTHONFILES))
%.pylint:
$(PYLINT) $(PYLINTFLAGS) $*.py
pytests: FORCE
echo $(USER_DB_FILE)
export TEST_DB=1; pytest $(PYTESTFLAGS) --cov=$(PKG)
# test a python file:
%.py: FORCE
$(PYLINT) $(PYLINTFLAGS) $@
export TEST_DB=1; pytest $(PYTESTFLAGS) tests/test_$*.py
nocrud:
-rm *~
-rm *.log
-rm *.out
-rm .*swp
-rm $(TESTDIR)/*~