Skip to content

Commit 043c372

Browse files
committed
Add a Makefile, so users with less knowladge can easily build the project, generate docs and run tests.
1 parent 8f21180 commit 043c372

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

Makefile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Some simple testing tasks (sorry, UNIX only).
2+
3+
FLAGS=
4+
KAFKA_VERSION=0.11.0.0
5+
SCALA_VERSION=2.11
6+
7+
setup:
8+
pip install -r requirements-dev.txt
9+
pip install -Ue .
10+
11+
# Test and produce coverage using tox. This is the same as is run on Travis
12+
test36:
13+
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py36 -- $(FLAGS)
14+
15+
test27:
16+
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS)
17+
18+
# Test using py.test directly if you want to use local python. Useful for other
19+
# platforms that require manual installation for C libraries, ie. Windows.
20+
test-local:
21+
py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF kafka test
22+
23+
cov-local:
24+
py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka \
25+
--cov-config=.covrc --cov-report html kafka test
26+
@echo "open file://`pwd`/htmlcov/index.html"
27+
28+
# Check the readme for syntax errors, which can lead to invalid formatting on
29+
# PyPi homepage (https://pypi.python.org/pypi/kafka-python)
30+
check-readme:
31+
python setup.py check -rms
32+
33+
clean:
34+
rm -rf `find . -name __pycache__`
35+
rm -f `find . -type f -name '*.py[co]' `
36+
rm -f `find . -type f -name '*~' `
37+
rm -f `find . -type f -name '.*~' `
38+
rm -f `find . -type f -name '@*' `
39+
rm -f `find . -type f -name '#*#' `
40+
rm -f `find . -type f -name '*.orig' `
41+
rm -f `find . -type f -name '*.rej' `
42+
rm -f .coverage
43+
rm -rf htmlcov
44+
rm -rf docs/_build/
45+
rm -rf cover
46+
rm -rf dist
47+
48+
doc:
49+
make -C docs html
50+
@echo "open file://`pwd`/docs/_build/html/index.html"
51+
52+
.PHONY: all test36 test27 test-local cov-local clean doc

0 commit comments

Comments
 (0)