-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
64 lines (50 loc) · 1.29 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
63
64
## makefile automates the build and deployment for python projects
## Build system
#
PROJ_TYPE = python
PROJ_MODULES = git python-resources python-doc python-doc-deploy markdown
PROJ_ARGS = -c resources/deepnlp.conf
PY_DEP_POST_DEPS += modeldeps
CLEAN_ALL_DEPS += exampleclean
CLEAN_DEPS += pycleancache
## Project
#
EXAMPLE_DIR = example
## API docs
#
PY_DOC_MD_SRC = ./doc/md
## Targets
#
include ./zenbuild/main.mk
## Targets
#
# download [spacy models](https://spacy.io/models/en)
.PHONY: modeldeps
modeldeps:
$(PIP_BIN) install $(PIP_ARGS) -r $(PY_SRC)/requirements-model.txt
# install score method dependencies
.PHONY: scoredeps
scoredeps:
$(PIP_BIN) install $(PIP_ARGS) -r $(PY_SRC)/requirements-score.txt
# clean example output
.PHONY: exampleclean
exampleclean:
@for i in $(EXAMPLE_DIR)/* ; do \
( cd $$i ; ./harness.py clean ) ; \
done || true
# unit and integration tests
.PHONY: testall
testall: test
@for i in $(EXAMPLE_DIR)/* ; do \
echo --- testing $$i ; \
( cd $$i ; ./harness.py clean ; ./harness.py traintest ) ; \
done
# cleanup noteobook
.PHONY: resetnb
resetnb:
@for i in $(EXAMPLE_DIR)/* ; do \
if [ -d $(EXAMPLE_DIR)/$$i/notebook ] ; then \
echo resetting $$i ; \
( cd $(EXAMPLE_DIR)/$$i/notebook ; git checkout . ) ; \
fi ; \
done