-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 787 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 787 Bytes
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
src_dir := igd
python ?= python3.6
VIRTUAL_ENV ?= pyenv
pip := $(VIRTUAL_ENV)/bin/python -m pip
pytest := $(VIRTUAL_ENV)/bin/py.test
linter := $(VIRTUAL_ENV)/bin/python -m flake8
py_requirements ?= requirements/prod.txt requirements/dev.txt
mypy := $(VIRTUAL_ENV)/bin/python -m mypy
.PHONY: test
test: $(VIRTUAL_ENV)
PYTHONPATH=$(PYTHONPATH):. $(pytest) -s --cov-report term-missing \
--cov=$(src_dir) --cov-branch tests
.PHONY: lint
lint: $(VIRTUAL_ENV)
$(linter) $(src_dir)
.PHONY: check-types
check-types: $(VIRTUAL_ENV)
$(mypy) --ignore-missing-imports $(src_dir)
.PHONY: security-test
security-test: $(virtualenv_dir)
$(VIRTUAL_ENV)/bin/bandit -r $(src_dir)
$(VIRTUAL_ENV): $(py_requirements)
$(python) -m venv $@
for r in $^ ; do \
$(pip) install -r $$r ; \
done