forked from bfontaine/freesms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (44 loc) · 1.16 KB
/
Copy pathMakefile
File metadata and controls
60 lines (44 loc) · 1.16 KB
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
SRC=freesms
COVERFILE:=.coverage
COVERAGE_REPORT:=report -m
VENV=venv
BINUTILS=$(VENV)/bin
PIP=$(BINUTILS)/pip
PYTHON=$(BINUTILS)/python
PY_VERSION:=$(subst ., ,$(shell python --version 2>&1 | cut -d' ' -f2))
PY_VERSION_MAJOR:=$(word 1,$(PY_VERSION))
PY_VERSION_MINOR:=$(word 2,$(PY_VERSION))
PY_VERSION_SHORT:=$(PY_VERSION_MAJOR).$(PY_VERSION_MINOR)
ifdef TRAVIS_PYTHON_VERSION
PY_VERSION_SHORT:=$(TRAVIS_PYTHON_VERSION)
endif
.PHONY: check check-versions stylecheck covercheck coverhtml
default: deps check-versions
deps: $(VENV)
$(PIP) install -qr requirements.txt
ifneq ($(PY_VERSION_SHORT),3.3)
ifneq ($(PY_VERSION_SHORT),3.4)
$(PIP) install -q wsgiref==0.1.2
endif
endif
$(VENV):
virtualenv $@
check:
$(PYTHON) tests/test.py
check-versions:
$(BINUTILS)/tox
stylecheck:
$(BINUTILS)/pep8 $(SRC)
covercheck:
$(BINUTILS)/coverage run --source=$(SRC) tests/test.py
$(BINUTILS)/coverage $(COVERAGE_REPORT)
coverhtml:
@make COVERAGE_REPORT=html covercheck
@echo '--> open htmlcov/index.html'
clean:
find . -name '*~' -delete
rm -f $(COVERFILE)
publish: stylecheck check-versions
cp README.rst README
$(BINUTILS)/python setup.py sdist upload
rm -f README