-
Notifications
You must be signed in to change notification settings - Fork 175
/
Makefile
63 lines (45 loc) · 1.55 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
APP := redisolar
PORT := 8081
PYTHON3_8 := $(shell command -v python3.8 2> /dev/null)
ifndef PYTHON3_8
$(error "Python 3.8 is not installed! See README.md")
endif
ifeq (${IS_CI}, true)
FLAGS := "--ci"
else
FLAGS := "-s"
endif
.PHONY: mypy test all clean dev load frontend timeseries-docker deps
all: env mypy lint test
env: env/bin/activate
env/bin/activate: requirements.txt
test -d env || python3.8 -m venv env
. env/bin/activate; pip install --upgrade pip; pip install pip-tools wheel -e .; pip-sync requirements.txt requirements-dev.txt
touch env/bin/activate
mypy: env
. env/bin/activate; mypy --ignore-missing-imports redisolar
test: env
. env/bin/activate; pytest $(FLAGS)
lint: env
. env/bin/activate; pylint redisolar
clean:
rm -rf env
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
dev: env
. env/bin/activate; FLASK_ENV=development FLASK_APP=$(APP) FLASK_DEBUG=1 flask run --port=$(PORT) --host=0.0.0.0
requirements.txt: requirements.in
pip-compile requirements.in > requirements.txt
requirements-dev.txt: requirements-dev.in
pip-compile requirements-dev.in > requirements-dev.txt
deps: requirements-dev.txt requirements.txt
frontend: env
cd frontend; npm run build
rm -rf redisolar/static
cp -r frontend/dist/static redisolar/static
cp frontend/dist/index.html redisolar/static/
load: env
. env/bin/activate; FLASK_APP=$(APP) flask load
timeseries-docker:
docker run -p 6379:6379 -it -d --rm redislabs/redistimeseries
timeseries-podman:
podman run -p 6379:6379 -it -d --rm redislabs/redistimeseries