-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 817 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 817 Bytes
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
VIRTUALENV=env
V_PATH=$(VIRTUALENV)/bin
V_COMMAND=source $(V_PATH)/activate;
TIME_NOW=$(shell date -u '+%s')
.PHONY: all clean setup test run crawl display
all: clean setup test
clean:
rm -f crawlit/*.pyc
rm -rf $(VIRTUALENV)
rm -rf output
setup:
python3 -m venv $(VIRTUALENV)
$(V_COMMAND) pip install --upgrade setuptools
$(V_COMMAND) pip install -r requirements.txt
$(V_COMMAND) pip install -e .
mkdir output
test:
$(V_COMMAND) python3 -m pytest --verbose
run:
CRAWLIT_JSON_FILE=output/crawlit.${TIME_NOW}.json ${MAKE} just-crawl ${MAKE} display
crawl:
CRAWLIT_JSON_FILE=output/crawlit.${TIME_NOW}.json ${MAKE} just-crawl
just-crawl:
$(V_COMMAND) scrapy crawl -a url=${url} spider -o ${CRAWLIT_JSON_FILE} -t jsonlines
display:
$(V_COMMAND) python3 crawlit/display.py ${CRAWLIT_JSON_FILE} -ob