-
Notifications
You must be signed in to change notification settings - Fork 142
/
Makefile
61 lines (46 loc) · 1.26 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
# term2048's Makefile
#
SRC=term2048
VENV=./venv
BINPREFIX=$(VENV)/bin/
PIP=$(BINPREFIX)pip
COVERFILE:=.coverage
COVERAGE_REPORT:=report -m
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
.DEFAULT: check-versions
.PHONY: check check-versions stylecheck covercheck
deps: $(VENV)
$(PIP) install -r requirements.txt
ifeq ($(PY_VERSION_SHORT),2.6)
$(PIP) install -r py26-requirements.txt
endif
ifeq ($(PY_VERSION_MAJOR),2)
$(PIP) install wsgiref==0.1.2
endif
$(VENV):
virtualenv --python python2 $@
check: deps
$(BINPREFIX)python tests/test.py
check-versions: deps
$(BINPREFIX)tox
stylecheck: deps
$(BINPREFIX)pep8 $(SRC)
covercheck: deps
$(BINPREFIX)coverage run --source=term2048 tests/test.py
$(BINPREFIX)coverage $(COVERAGE_REPORT)
coverhtml:
@$(MAKE) COVERAGE_REPORT=html BINPREFIX=$(BINPREFIX) covercheck
@echo '--> open htmlcov/index.html'
clean:
rm -f *~ */*~
rm -f $(COVERFILE)
sdist: deps check-versions
$(BINPREFIX)python setup.py sdist
publish: deps check-versions
$(BINPREFIX)python setup.py sdist upload