-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (38 loc) · 1020 Bytes
/
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
VENV_NAME="venv"
TEST_SRC = $(shell find tests/ -type f -name '*.py')
APP_SRC = $(shell find app/ -type f -name '*.py')
APP_SRC += roon_remote.py
.PHONY = check
check: venv linter pytest Makefile
@echo "==> make check DONE"
venv: .built-venv
pytest: .built-pytest
.built-pytest: ${TEST_SRC} ${APP_SRC}
( \
. ${VENV_NAME}/bin/activate; \
python -m pytest -v tests/; \
touch $@; \
)
.built-venv: requirements.txt
( \
python3 -m venv ${VENV_NAME}; \
. ${VENV_NAME}/bin/activate; \
pip install --upgrade pip; \
pip install -r requirements.txt; \
touch $@;\
)
.built-linter: venv requirements.txt ${APP_SRC}
@(\
. venv/bin/activate; \
echo "=============== FLAKE8 ========================="; \
python -m flake8 --max-line-length 120 roon_remote.py; \
echo -e "==> FLAKE8 is Done\n"; \
echo "=============== PYLINT ========================="; \
python -m pylint roon_remote.py; \
echo "==> PYLINT is Done"; \
touch $@; \
)
linter: .built-linter
clean:
rm -f .built-*
rm -rf ${VENV_NAME}