Skip to content

Commit dd8e336

Browse files
Merge pull request dpkp#1247 from dpkp/add_makefile
Add a Makefile
2 parents cfddc6b + 2d36082 commit dd8e336

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

Makefile

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

requirements-dev.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
flake8==3.4.1
2+
pytest==3.2.2
3+
pytest-cov==2.5.1
4+
pytest-catchlog==1.2.2
5+
docker-py==1.10.6
6+
coveralls==1.2.0
7+
Sphinx==1.6.4
8+
lz4==0.10.1
9+
xxhash==1.0.1
10+
python-snappy==0.5.1
11+
tox==2.9.1
12+
pytest-pylint==0.7.1
13+
# pytest-sugar==0.9.0
14+
pytest-mock==1.6.3
15+
sphinx-rtd-theme==0.2.4

0 commit comments

Comments
 (0)