-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
80 lines (63 loc) · 2.84 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
########################################################
NAME := ftl_installer
# VERSION file provides one place to update the software version.
VERSION := $(shell cat VERSION)
ifndef FTL_PYTHON
FTL_PYTHON=python
endif
PYVER=$(shell $(FTL_PYTHON) -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")
__init__.py: ftl_installer/__init__.py.in
sed "s/%VERSION%/$(VERSION)/" $< > ftl_installer/__init__.py
setup.py: setup.py.in
sed "s/%VERSION%/$(VERSION)/" $< > setup.py
clean:
@find . -type f -regex ".*\.py[co]$$" -delete
@find . -type f \( -name "*~" -or -name "#*" \) -delete
@rm -fR venv$(PYVER) build dist $(NAME).egg-info
@rm -fR setup.py ftl_installer/__init__.py
venv: clean __init__.py setup.py
@echo "#############################################"
@echo "# Creating a python-$(PYVER) virtualenv"
@echo "#############################################"
virtualenv -p $(FTL_PYTHON) venv$(PYVER)
. venv$(PYVER)/bin/activate && pip install -r requirements.txt
. venv$(PYVER)/bin/activate && pip install -r test-requirements.txt
. venv$(PYVER)/bin/activate && python setup.py develop
install: __init__.py setup.py
python setup.py install
pip install -r test-requirements.txt
pip install coveralls
nosetests: __init__.py setup.py
@echo "#############################################"
@echo "# Running Unit Tests"
@echo "#############################################"
$(FTL_PYTHON) setup.py nosetests
pep8: __init__.py setup.py
@echo "#############################################"
@echo "# Running PEP8 Compliance Tests"
@echo "#############################################"
pep8 --max-line-length=120 --exclude="tests/*,venv$(PYVER)/*" --ignore=E501,E121,E124 $(NAME)/
pyflakes: __init__.py setup.py
@echo "#############################################"
@echo "# Running Pyflakes Sanity Tests"
@echo "# Note: most import errors may be ignored"
@echo "#############################################"
pyflakes $(NAME)/
ci-nosetests: __init__.py setup.py
@echo "#############################################"
@echo "# Running Unit Tests"
@echo "#############################################"
. venv$(PYVER)/bin/activate && python setup.py nosetests
ci-pep8: __init__.py setup.py
@echo "#############################################"
@echo "# Running PEP8 Compliance Tests"
@echo "#############################################"
. venv$(PYVER)/bin/activate && pep8 --max-line-length=120 --exclude="tests/*,venv$(PYVER)/*" --ignore=E501,E121,E124 $(NAME)/
ci-pyflakes: __init__.py setup.py
@echo "#############################################"
@echo "# Running Pyflakes Sanity Tests"
@echo "# Note: most import errors may be ignored"
@echo "#############################################"
. venv$(PYVER)/bin/activate && pyflakes $(NAME)/
ci: clean venv ci-nosetests ci-pep8 ci-pyflakes
test: nosetests pep8 pyflakes