-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (40 loc) · 1008 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
48
49
50
51
.PHONY: install run travis-install travis-test travis-coverage
VENV_DIR ?= .env
PYTHON = python
REQUIREMENTS = requirements.txt
install:
$(VENV_DIR)/bin/$(PYTHON) setup.py install
init:
clear
rm -rf $(VENV_DIR)
@$(MAKE) $(VENV_DIR)
@$(MAKE) install
clean:
find . -iname "*.pyc" -delete
find . -iname "*.pyo" -delete
find . -iname "__pycache__" -delete
test:
clear
$(VENV_DIR)/bin/$(PYTHON) -m unittest discover
coverage:
clear
$(VENV_DIR)/bin/$(PYTHON) -m coverage run -m unittest discover
$(VENV_DIR)/bin/$(PYTHON) -m coverage report -m
travis-install:
python -m pip install -r requirements.txt
travis-test:
python -m unittest discover
travis-coverage:
python -m coverage run -m unittest discover
pep8:
clear
$(VENV_DIR)/bin/flake8 .
$(VENV_DIR):
virtualenv $(VENV_DIR)
if [ -a $(REQUIREMENTS) ] ; \
then \
$(VENV_DIR)/bin/pip install -r requirements.txt ; \
else \
$(VENV_DIR)/bin/pip install flake8 coverage; \
$(VENV_DIR)/bin/pip freeze > requirements.txt ; \
fi;