forked from Liu-Feng-deeplearning/CoverHunter
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
34 lines (27 loc) · 859 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
PYTHON = python3
PIP = $(PYTHON) -m pip
VIRTUALENV = $(PYTHON) -m venv
VENV_OPTS += --clear
VENV = .venv
in_venv = . $(VENV)/bin/activate &&
$(VENV)/bin/activate:
$(VIRTUALENV) $(VENV_OPTS) $(VENV)
$(in_venv) $(PIP) install --upgrade pip setuptools wheel
$(VENV)/bin/coverage: $(VENV)/bin/activate
$(in_venv) $(PIP) install -r requirements.txt
tests coverage: TESTS = `find tests/ -name 'test_*.py'`
.PHONY: virtualenv
virtualenv: $(VENV)/bin/activate
.PHONY: tests
tests: $(VENV)/bin/coverage
$(in_venv) $(PYTHON) -Wd -m unittest -c $(TESTS)
.PHONY: coverage
coverage: $(VENV)/bin/coverage
$(in_venv) $(PYTHON) -Wd -m coverage run \
--source=src \
-m unittest -c $(TESTS)
$(in_venv) $(PYTHON) -m coverage report
$(in_venv) $(PYTHON) -m coverage html
.PHONY: format
format: $(VENV)/bin/coverage
$(in_venv) black --line-length=100 src tests