Line | |
---|
1 | PY_SRC_FILES = $(wildcard *.py) $(wildcard rtemsqual/*.py) |
---|
2 | PY_ALL_FILES = $(PY_SRC_FILES) $(wildcard rtemsqual/tests/*.py) |
---|
3 | |
---|
4 | all: check format analyse coverage-report |
---|
5 | |
---|
6 | check: check-env |
---|
7 | coverage run --branch -m pytest -vv rtemsqual/tests |
---|
8 | |
---|
9 | format: $(PY_ALL_FILES) | check-env |
---|
10 | yapf -i $^ |
---|
11 | |
---|
12 | analyse: $(PY_SRC_FILES) | check-env |
---|
13 | flake8 $^ |
---|
14 | mypy $^ |
---|
15 | pylint $^ |
---|
16 | |
---|
17 | check-env: |
---|
18 | test -n "$$VIRTUAL_ENV" |
---|
19 | |
---|
20 | EMPTY := |
---|
21 | SPACE := $(EMPTY) $(EMPTY) |
---|
22 | COMMA := , |
---|
23 | |
---|
24 | coverage-report: |
---|
25 | coverage report -m --include=$(subst $(SPACE),$(COMMA),$(PY_SRC_FILES)) |
---|
26 | |
---|
27 | .PONY: env |
---|
28 | |
---|
29 | env: |
---|
30 | python3 -m venv env |
---|
31 | . env/bin/activate && pip install --upgrade pip && pip install -r requirements.txt |
---|
Note: See
TracBrowser
for help on using the repository browser.