-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
87 lines (70 loc) · 1.91 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
DIST_DIR = tensorhive/app/web/dist
CONFIG_DIR = ~/.config/TensorHive
# Global TODOs
# TODO Nice to have: make dist
all:
make app
make dev
make dev-deps
make docs
make codestyle
app:
$(call yellow, "Checking for existing web app build distribution...")
ifneq ($(wildcard $(DIST_DIR)),)
$(call red, "Skipping building web app because directory $(DIST_DIR) already exists.")
else
$(call red, "$(DIST_DIR) not found...")
$(call green, "Building Vue.js web app...")
(cd tensorhive/app/web/dev && npm install && npm run build)
endif
$(call green, "Done.\n")
dev:
@echo "Installing TensorHive in editable package mode..."
pip install --quiet --editable .
$(call green, "Done.\n")
dev-deps:
@echo "Installing additinal dependencies for development/testing..."
pip install -r requirements-dev.txt
$(call green, "Done.\n")
docs:
@echo "Generating pdoc documentation for TensorHive Core..."
pdoc --html tensorhive.core --only-pypath --overwrite --html-dir docs/ && mv docs/tensorhive/core/* docs/
$(call green, "Done. You can now browse the docs via: firefox docs/index.html\n")
clean-config:
$(call yellow, "Cleaning existing configuration files...")
ifneq ($(wildcard $(CONFIG_DIR)),)
- cd $(CONFIG_DIR) && rm *.ini
$(call green, "Done.\n")
else
@echo "$(CONFIG_DIR) does not exist, continuing...\n"
endif
clean:
$(call red, "1. Removing web app build artifacts...")
rm --recursive --force $(DIST_DIR)
$(call green, "Done.\n")
$(call red, "2. Uninstalling TensorHive...")
pip uninstall --yes tensorhive
$(call green, "Done.\n")
$(call red, "3. Removing docs...")
rm --recursive --force docs
$(call green, "Done.\n")
codestyle:
- mypy tensorhive tests
@echo "-------------------------------------------"
python -m flake8 tensorhive tests
define red
@tput setaf 1
@echo $1
@tput sgr0
endef
define green
@tput setaf 2
@echo $1
@tput sgr0
endef
define yellow
@tput setaf 3
@echo $1
@tput sgr0
endef
.PHONY: all