-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
58 lines (44 loc) · 1.18 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
.PHONY: install
FOLDER :=
ifeq ($(OS),Windows_NT)
FOLDER:=Scripts
else
FOLDER:=bin
endif
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/$(FOLDER)/activate
PYTHON=${VENV_NAME}/$(FOLDER)/python
# Requirements are in setup.py, so whenever setup.py is changed, re-run installation of dependencies.
install: create activate
sphinx-docs: activate
rm -rf docs/source/
rm -rf docs/_build/
sphinx-apidoc -o docs/source/ postr
sphinx-build -M html docs/ docs/_build
create:
ifeq ($(OS),Windows_NT)
virtualenv venv
else
python3 -m venv venv
endif
activate:
source $(VENV_NAME)$(VENV_PATH)/$(FOLDER)/activate; \
$(VENV_NAME)$(VENV_PATH)/$(FOLDER)/pip install -r prerequirements.txt; \
$(VENV_NAME)$(VENV_PATH)/$(FOLDER)/pip install -r requirements.txt; \
test: activate
${PYTHON} -m tox; \
run: activate
${PYTHON} postr/app.py \
clean:
rm -rf venv
twitter: activate
${PYTHON} -m postr.twitter_postr \
setupTextblob: activate
${PYTHON} -m textblob.download_corpora \
database: activate
${PYTHON} -m scripts.dbsetup \
gui: activate
${PYTHON} -m postr.main
gui2: activate
${PYTHON} -m postr.schedule.reader & ${PYTHON} -m postr.main2
# link : https://blog.horejsek.com/makefile-with-python/