-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (53 loc) · 1.32 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY: clean install test
DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SHELL=/bin/bash
ENV := $(DIR)/env/bin
PYTHON := $(ENV)/python
PIP := $(ENV)/pip
FAB := $(ENV)/fab
PELICAN := $(ENV)/pelican
STATUS_ERROR := \033[1;31m*\033[0m Error
STATUS_OK := \033[1;32m*\033[0m OK
clean: clean-pyc
-rm -rf build
-rm -f codetags.html
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
install-env-python2:
rm -rf "$(DIR)/env/" ;\
virtualenv -p /usr/bin/python2 --clear "$(DIR)/env/" ;\
if [ $$? -eq 0 ]; then \
echo -e "${STATUS_OK}" ;\
else \
echo -e "${STATUS_ERROR}" ;\
fi;
install-env-python3:
rm -rf "$(DIR)/env/" ;\
virtualenv -p /usr/bin/python3 --clear "$(DIR)/env/" ;\
if [ $$? -eq 0 ]; then \
echo -e "${STATUS_OK}" ;\
else \
echo -e "${STATUS_ERROR}" ;\
fi;
env-activate:
. $(ENV)/activate
install-python-libs:
$(PIP) install -U pip ;\
$(PIP) install --no-cache-dir --upgrade -r "$(DIR)/requirements.txt" ;\
if [ $$? -eq 0 ]; then \
echo -e "${STATUS_OK}" ;\
else \
echo -e "${STATUS_ERROR}" ;\
fi;
install: install-env-python3 env-activate install-python-libs
test:
$(DIR)/env/bin/py.test \
-v \
-q --flakes \
--cov-config=.coveragerc \
--cov=quicksets \
--cov-report=html \
--doctest-modules \
tests