-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
94 lines (75 loc) · 2.38 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
config = cfg.DevConfig
cwb_id = GERMAPARL1386
# cwb_id = GERMAPARL-1949-2021
meta = tests/corpora/germaparl-meta.tsv
# meta = ../thesis/ccc-analyses/meta-data/germaparl-speaker-nodes.tsv.gz
subcorpora = tests/corpora/germaparl-subcorpora.tsv
# subcorpora = ../norm-rechts/outreach/cpss-2024/subcorpora.tsv
# subcorpora = ../thesis/ccc-analyses/case-studies/norm-rechts/subcorpora-*.tsv
discoursemes = tests/discoursemes/climate-change.tsv
# discoursemes = "../*-discoursemes.tsv"
library = tests/library/
install:
python3 -m venv venv && \
. venv/bin/activate && \
pip3 install -U pip setuptools wheel && \
pip3 install -r requirements.txt
nvm:
. ${NVM_DIR}/nvm.sh && cd frontend && nvm use && $(CMD)
install_frontend:
make nvm CMD="npm install"
apispec:
. venv/bin/activate && \
flask --app cads spec > openapi.json
###############
# DEVELOPMENT #
###############
init:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads database init
corpora:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads corpus import
subcorpora:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads corpus subcorpora ${cwb_id} ${subcorpora}
discoursemes:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads discourseme import --path_in ${discoursemes}
library:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads library import-library --lib_dir ${library}
examples: init corpora discoursemes
run:
. venv/bin/activate && \
export CWB_CADS_CONFIG=${config} && \
flask --app cads --debug run
run_frontend:
make nvm CMD="npm run dev"
########
# TEST #
########
lint:
. venv/bin/activate && \
pylint --recursive y --rcfile=.pylintrc cads/
test:
. venv/bin/activate && \
export CWB_CADS_CONFIG=cfg.TestConfig && \
pytest -s -v
test_examples:
. venv/bin/activate && \
export CWB_CADS_CONFIG=cfg.TestConfig && \
flask --app cads database init && \
flask --app cads corpus import && \
flask --app cads corpus read-meta "GERMAPARL1386" --path "tests/corpora/germaparl-meta.tsv" && \
flask --app cads corpus subcorpora "GERMAPARL1386" "tests/corpora/germaparl-subcorpora.tsv" && \
flask --app cads discourseme import --path_in "tests/discoursemes/germaparl.tsv"
test_run:
. venv/bin/activate && \
export CWB_CADS_CONFIG=cfg.TestConfig && \
flask --app cads --debug run