summaryrefslogtreecommitdiff
path: root/Makefile
blob: b755d07ea7c9f8eeabbb576fbb94c4b92033767d (plain)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Makefile for utility work on Coverage.

default:
	@echo "* No default action *"

clean:
	-rm -f *.pyd */*.pyd
	-rm -f *.so */*.so
	-PYTHONPATH=. python tests/test_farm.py clean
	-rm -rf build coverage.egg-info dist htmlcov
	-rm -f *.pyc */*.pyc */*/*.pyc */*/*/*.pyc */*/*/*/*.pyc */*/*/*/*/*.pyc
	-rm -f *.pyo */*.pyo */*/*.pyo */*/*/*.pyo */*/*/*/*.pyo */*/*/*/*/*.pyo
	-rm -f *.bak */*.bak */*/*.bak */*/*/*.bak */*/*/*/*.bak */*/*/*/*/*.bak
	-rm -f *$$py.class */*$$py.class */*/*$$py.class */*/*/*$$py.class */*/*/*/*$$py.class */*/*/*/*/*$$py.class
	-rm -rf __pycache__ */__pycache__ */*/__pycache__ */*/*/__pycache__ */*/*/*/__pycache__ */*/*/*/*/__pycache__
	-rm -f coverage/*,cover
	-rm -f MANIFEST
	-rm -f .coverage .coverage.* coverage.xml .metacov* .noseids
	-rm -f tests/zipmods.zip
	-rm -rf tests/eggsrc/build tests/eggsrc/dist tests/eggsrc/*.egg-info
	-rm -f setuptools-*.egg distribute-*.egg distribute-*.tar.gz
	-rm -rf doc/_build doc/_spell

sterile: clean
	-rm -rf .tox*

LINTABLE = coverage igor.py setup.py tests

lint:
	-pylint $(LINTABLE)
	python -m tabnanny $(LINTABLE)
	python igor.py check_eol

spell:
	-pylint --disable=all --enable=spelling $(LINTABLE)

pep8:
	pep8 --filename=*.py --ignore=E401,E301 --repeat coverage

test:
	tox -e py27 $(ARGS)

metacov:
	COVERAGE_COVERAGE=yes tox $(ARGS)

metahtml:
	python igor.py combine_html

# Kitting

# For kitting on Windows:
# SDIST_CMD = python setup.py sdist --keep-temp --formats=gztar fixtar --owner=ned --group=coverage --clean
SDIST_CMD = python setup.py sdist --formats=gztar

kit:
	$(SDIST_CMD)

kit_upload:
	$(SDIST_CMD) upload

kit_local:
	cp -v dist/* `awk -F "=" '/find-links/ {print $$2}' ~/.pip/pip.conf`

pypi:
	python setup.py register

install:
	python setup.py install

DEVINST_FILE = coverage.egg-info/PKG-INFO
devinst: $(DEVINST_FILE)
$(DEVINST_FILE): coverage/tracer.c
	-rm coverage/tracer.pyd
	python setup.py develop

uninstall:
	-rm -rf $(PYHOME)/lib/site-packages/coverage*
	-rm -rf $(PYHOME)/scripts/coverage*

# Documentation

SPHINXBUILD = sphinx-build
SPHINXOPTS = -a -E doc
WEBHOME = ~/web/stellated/pages/code/coverage

docreqs:
	pip install -r doc/requirements.txt

px: docreqs
	$(SPHINXBUILD) -b px $(SPHINXOPTS) doc/_build/px
	rm doc/_build/px/search.px
	python doc/_ext/px_cleaner.py doc/_build/px/*.px

dochtml: docreqs
	$(SPHINXBUILD) -b html $(SPHINXOPTS) doc/_build/html
	@echo
	@echo "Build finished. The HTML pages are in doc/_build/html."

docspell: docreqs
	$(SPHINXBUILD) -b spelling $(SPHINXOPTS) doc/_spell

publish: px
	rm -f $(WEBHOME)/*.px
	cp doc/_build/px/*.px $(WEBHOME)
	rm -f $(WEBHOME)/sample_html/*.*
	cp doc/sample_html/*.* $(WEBHOME)/sample_html

publishbeta: px
	rm -f $(WEBHOME)/beta/*.px
	mkdir -p $(WEBHOME)/beta
	cp doc/_build/px/*.px $(WEBHOME)/beta
	rm -f $(WEBHOME)/sample_html_beta/*.*
	mkdir -p $(WEBHOME)/sample_html_beta
	cp doc/sample_html_beta/*.* $(WEBHOME)/sample_html_beta