1# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
3
4# Makefile for utility work on coverage.py.
5
6default:
7	@echo "* No default action *"
8
9clean:
10	-rm -f *.pyd */*.pyd
11	-rm -f *.so */*.so
12	-PYTHONPATH=. python tests/test_farm.py clean
13	-rm -rf build coverage.egg-info dist htmlcov
14	-rm -f *.pyc */*.pyc */*/*.pyc */*/*/*.pyc */*/*/*/*.pyc */*/*/*/*/*.pyc
15	-rm -f *.pyo */*.pyo */*/*.pyo */*/*/*.pyo */*/*/*/*.pyo */*/*/*/*/*.pyo
16	-rm -f *.bak */*.bak */*/*.bak */*/*/*.bak */*/*/*/*.bak */*/*/*/*/*.bak
17	-rm -f *$$py.class */*$$py.class */*/*$$py.class */*/*/*$$py.class */*/*/*/*$$py.class */*/*/*/*/*$$py.class
18	-rm -rf __pycache__ */__pycache__ */*/__pycache__ */*/*/__pycache__ */*/*/*/__pycache__ */*/*/*/*/__pycache__
19	-rm -f coverage/*,cover
20	-rm -f MANIFEST
21	-rm -f .coverage .coverage.* coverage.xml .metacov* .noseids
22	-rm -f tests/zipmods.zip
23	-rm -rf tests/eggsrc/build tests/eggsrc/dist tests/eggsrc/*.egg-info
24	-rm -f setuptools-*.egg distribute-*.egg distribute-*.tar.gz
25	-rm -rf doc/_build doc/_spell
26
27sterile: clean
28	-rm -rf .tox*
29
30LINTABLE = coverage igor.py setup.py tests ci/*.py
31
32lint:
33	-pylint $(LINTABLE)
34	python -m tabnanny $(LINTABLE)
35	python igor.py check_eol
36
37spell:
38	-pylint --disable=all --enable=spelling $(LINTABLE)
39
40pep8:
41	pep8 --filename=*.py --repeat $(LINTABLE)
42
43test:
44	tox -e py27,py34 $(ARGS)
45
46metacov:
47	COVERAGE_COVERAGE=yes tox $(ARGS)
48
49metahtml:
50	python igor.py combine_html
51
52# Kitting
53
54kit:
55	python setup.py sdist --formats=gztar,zip
56
57wheel:
58	tox -c tox_wheels.ini $(ARGS)
59
60kit_upload:
61	twine upload dist/*
62
63kit_local:
64	cp -v dist/* `awk -F "=" '/find-links/ {print $$2}' ~/.pip/pip.conf`
65	# pip caches wheels of things it has installed. Clean them out so we
66	# don't go crazy trying to figure out why our new code isn't installing.
67	find ~/Library/Caches/pip/wheels -name 'coverage-*' -delete
68
69download_appveyor:
70	python ci/download_appveyor.py nedbat/coveragepy
71
72pypi:
73	python setup.py register
74
75build_ext:
76	python setup.py build_ext
77
78install:
79	python setup.py install
80
81uninstall:
82	-rm -rf $(PYHOME)/lib/site-packages/coverage*
83	-rm -rf $(PYHOME)/scripts/coverage*
84
85# Documentation
86
87SPHINXBUILD = sphinx-build
88SPHINXOPTS = -a -E doc
89WEBHOME = ~/web/stellated/
90WEBSAMPLE = $(WEBHOME)/files/sample_coverage_html
91WEBSAMPLEBETA = $(WEBHOME)/files/sample_coverage_html_beta
92
93docreqs:
94	pip install -r doc/requirements.pip
95
96dochtml:
97	$(SPHINXBUILD) -b html $(SPHINXOPTS) doc/_build/html
98	@echo
99	@echo "Build finished. The HTML pages are in doc/_build/html."
100
101docspell:
102	$(SPHINXBUILD) -b spelling $(SPHINXOPTS) doc/_spell
103
104publish:
105	rm -f $(WEBSAMPLE)/*.*
106	mkdir -p $(WEBSAMPLE)
107	cp doc/sample_html/*.* $(WEBSAMPLE)
108
109publishbeta:
110	rm -f $(WEBSAMPLEBETA)/*.*
111	mkdir -p $(WEBSAMPLEBETA)
112	cp doc/sample_html_beta/*.* $(WEBSAMPLEBETA)
113