Skip to content

Commit c0add71

Browse files
jeffwidmandpkp
authored andcommitted
Update travis test coverage: 2.7, 3.4, 3.7, pypy2.7 (#1614)
* Use xenial dist for travis builds * Use openjdk8 for all travis tests * Update python build matrix -- add 3.7, drop 3.5/3.6 (keep 2.7, 3.4, pypy2.7)
1 parent 994d283 commit c0add71

File tree

6 files changed

+40
-11
lines changed

6 files changed

+40
-11
lines changed

.travis.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
language: python
22

3+
dist: xenial
4+
35
python:
46
- 2.7
57
- 3.4
6-
- 3.5
7-
- 3.6
8-
- pypy
8+
- 3.7
9+
- pypy2.7-6.0
910

1011
env:
1112
- KAFKA_VERSION=0.8.2.2
@@ -18,21 +19,23 @@ addons:
1819
apt:
1920
packages:
2021
- libsnappy-dev
22+
- openjdk-8-jdk
2123

2224
cache:
2325
directories:
2426
- $HOME/.cache/pip
2527
- servers/
2628

2729
before_install:
30+
- source travis_java_install.sh
2831
- ./build_integration.sh
2932

3033
install:
3134
- pip install tox coveralls
3235
- pip install .
3336

3437
script:
35-
- tox -e `if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then echo pypy; else echo py${TRAVIS_PYTHON_VERSION/./}; fi`
38+
- tox -e `if [ "$TRAVIS_PYTHON_VERSION" == "pypy2.7-6.0" ]; then echo pypy; else echo py${TRAVIS_PYTHON_VERSION/./}; fi`
3639

3740
after_success:
3841
- coveralls

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ servers/$(KAFKA_VERSION)/kafka-bin:
1414
build-integration: servers/$(KAFKA_VERSION)/kafka-bin
1515

1616
# 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)
17+
test37: build-integration
18+
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py37 -- $(FLAGS)
1919

2020
test27: build-integration
2121
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS)
@@ -56,4 +56,4 @@ doc:
5656
make -C docs html
5757
@echo "open file://`pwd`/docs/_build/html/index.html"
5858

59-
.PHONY: all test36 test27 test-local cov-local clean doc
59+
.PHONY: all test37 test27 test-local cov-local clean doc

docs/compatibility.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release.
1212
Because the kafka server protocol is backwards compatible, kafka-python is
1313
expected to work with newer broker releases as well (2.0+).
1414

15-
kafka-python is tested on python 2.7, 3.4, 3.5, 3.6 and pypy.
15+
kafka-python is tested on python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy.
1616

1717
Builds and tests via Travis-CI. See https://travis-ci.org/dpkp/kafka-python

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def run(cls):
5757
"Programming Language :: Python :: 3.4",
5858
"Programming Language :: Python :: 3.5",
5959
"Programming Language :: Python :: 3.6",
60+
"Programming Language :: Python :: 3.7",
6061
"Programming Language :: Python :: Implementation :: PyPy",
6162
"Topic :: Software Development :: Libraries :: Python Modules",
6263
]

tox.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{26,27,34,35,36,py}, docs
2+
envlist = py{26,27,34,35,36,37,py}, docs
33

44
[pytest]
55
testpaths = kafka test
@@ -11,8 +11,8 @@ log_format = %(created)f %(filename)-23s %(threadName)s %(message)s
1111
deps =
1212
pytest<4.0
1313
pytest-cov
14-
py{27,34,35,36,py}: pylint
15-
py{27,34,35,36,py}: pytest-pylint
14+
py{27,34,35,36,37,py}: pylint
15+
py{27,34,35,36,37,py}: pytest-pylint
1616
pytest-mock
1717
mock
1818
python-snappy

travis_java_install.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# borrowed from: https://github.com/mansenfranzen/pywrangler/blob/master/tests/travis_java_install.sh
4+
5+
# Kafka requires Java 8 in order to work properly. However, TravisCI's Ubuntu
6+
# 16.04 ships with Java 11 and Java can't be set with `jdk` when python is
7+
# selected as language. Ubuntu 14.04 does not work due to missing python 3.7
8+
# support on TravisCI which does have Java 8 as default.
9+
10+
# show current JAVA_HOME and java version
11+
echo "Current JAVA_HOME: $JAVA_HOME"
12+
echo "Current java -version:"
13+
which java
14+
java -version
15+
16+
echo "Updating JAVA_HOME"
17+
# change JAVA_HOME to Java 8
18+
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
19+
20+
echo "Updating PATH"
21+
export PATH=${PATH/\/usr\/local\/lib\/jvm\/openjdk11\/bin/$JAVA_HOME\/bin}
22+
23+
echo "New java -version"
24+
which java
25+
java -version

0 commit comments

Comments
 (0)