Skip to content

Commit 0b89441

Browse files
committed
Simplify tox config, run tox on CI.
1 parent 8e5fc5e commit 0b89441

File tree

6 files changed

+36
-58
lines changed

6 files changed

+36
-58
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ install:
2222
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
2323
- python --version
2424
- python -m pip install -U pip
25+
- python -m pip install -U -r tests/requirements.txt
2526

2627
build_script:
2728
- tools/windows-build.bat

.travis.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ env:
33
- LIBRDKAFKA_VERSION=v1.5.2
44
jobs:
55
include:
6-
# Source package verification with Python 2.7
7-
- os: linux
6+
- name: "Source package verification with Python 2.7 (Linux)"
7+
os: linux
88
language: python
99
dist: trusty
1010
python: "2.7"
1111
env: LD_LIBRARY_PATH="$PWD/tmp-build/lib"
12-
# Source package verification with Python 3.6
13-
- os: linux
12+
- name: "Source package verification with Python 3.6 (Linux)"
13+
os: linux
1414
language: python
1515
dist: trusty
1616
python: "3.6"
1717
env: LD_LIBRARY_PATH="$PWD/tmp-build/lib"
18-
# Source package verification with Python 2.7
19-
- os: osx
18+
- name: "Source package verification with Python 2.7 (OSX)"
19+
os: osx
2020
python: "2.7"
2121
env: DYLD_LIBRARY_PATH="$PWD/tmp-build/lib" INTERPRETER_VERSION="2.7.17"
22-
# Source package verification with Python 3.6
23-
- os: osx
22+
- name: "Source package verification with Python 3.6 (OSX) +docs"
23+
os: osx
2424
python: "3.6"
2525
env: DYLD_LIBRARY_PATH="$PWD/tmp-build/lib" MK_DOCS="y" INTERPRETER_VERSION="3.6.5"
26-
# cibuildwheel for osx
27-
- os: osx
26+
- name: "cibuildwheel (OSX)"
27+
os: osx
2828
env: CIBW_BEFORE_BUILD="tools/bootstrap-librdkafka.sh --require-ssl ${LIBRDKAFKA_VERSION} tmp" CFLAGS="-Itmp/include" LDFLAGS="-Ltmp/lib" INTERPRETER_VERSION="2.7.17"
29-
# cibuildwheel for manylinux
30-
- os: linux
29+
- name: "cibuildwheel (manylinux)"
30+
os: linux
3131
dist: trusty
3232
env:
3333
- CIBW_BEFORE_BUILD="tools/prepare-cibuildwheel-linux.sh ${LIBRDKAFKA_VERSION}"
@@ -53,22 +53,20 @@ before_install:
5353
install:
5454
- tools/install-interceptors.sh
5555
- pip install -r tests/requirements.txt
56+
- pip install tox
5657
- flake8
5758
- if [[ $MK_DOCS == y ]]; then pip install -r docs/requirements.txt; fi
5859
- if [[ -z $CIBW_BEFORE_BUILD ]]; then tools/bootstrap-librdkafka.sh --require-ssl ${LIBRDKAFKA_VERSION} tmp-build && pip install --global-option=build_ext --global-option="-Itmp-build/include/" --global-option="-Ltmp-build/lib" . .[avro]; fi
5960

6061
# Build wheels
61-
script:
62-
- if [[ -n $TRAVIS_TAG && -n $CIBW_BEFORE_BUILD ]]; then cibuildwheel --output-dir wheelhouse1 && tools/fixup-wheels.sh wheelhouse1 wheelhouse; fi
63-
6462
# Make plugins available for tests
6563
# Execute tests if not CIBW_BEFORE_BUILD [osx, linux]
6664
# Execute integration tests if CIBW_BEFORE_BUILD
6765
# Build docs if MK_DOCS
68-
after_script:
66+
script:
67+
- if [[ -n $TRAVIS_TAG && -n $CIBW_BEFORE_BUILD ]]; then cibuildwheel --output-dir wheelhouse1 && tools/fixup-wheels.sh wheelhouse1 wheelhouse; fi
6968
- ldd staging/libs/* || otool -L staging/libs/* || true
70-
- if [[ -z $CIBW_BEFORE_BUILD && $TRAVIS_OS_NAME == "osx" ]]; then DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:staging/libs py.test --timeout=60 --ignore=tmp-build --import-mode append; fi
71-
- if [[ -z $CIBW_BEFORE_BUILD && $TRAVIS_OS_NAME == "linux" ]]; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:staging/libs py.test --timeout=60 --ignore=tmp-build --import-mode append; fi
69+
- [[ -n $CIBW_BEFORE_BUILD ]] || LD_LIBRARY_PATH=$LD_LIBRARY_PATH:staging/libs DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:staging/libs tox
7270
- if [[ -n $TRAVIS_TAG && $TRAVIS_OS_NAME == osx && -n $CIBW_BEFORE_BUILD ]]; then tools/test-wheel.sh wheelhouse; fi
7371
- if [[ $MK_DOCS == y ]]; then make docs; fi
7472

tests/integration/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
def kafka_cluster():
2929

3030
cluster = TrivupFixture({'with_sr': True,
31+
'cp_version': 'latest',
3132
'broker_conf': ['transaction.state.log.replication.factor=1',
3233
'transaction.state.log.min.isr=1']})
3334
try:

tests/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
flake8
2-
pytest==4.6.9;python_version<="3.0"
3-
pytest;python_version>="3.0"
4-
pytest-timeout
5-
requests-mock
6-
trivup
1+
flake8
2+
pytest==4.6.9;python_version<="3.0"
3+
pytest>=6.0.0;python_version>="3.0"
4+
pytest-timeout
5+
requests-mock
6+
trivup>=0.8.2

tools/windows-build.bat

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ for %%W in (wheelhouse\confluent_kafka-*cp%PYTHON_SHORTVER%*win*%PYTHON_ARCH%.wh
5151
python -c "import struct; print(struct.calcsize('P') * 8)"
5252
7z l %%~W
5353
pip install %%~W || exit /b 1
54+
pip install -r src\confluent_kafka\requirements.txt
55+
pip install -r src\confluent_kafka\avro\requirements.txt
5456

55-
SET savedir=%cd%
56-
cd ..
5757
python -c "from confluent_kafka import libversion ; print(libversion())" || exit /b 1
5858

59-
python -m pytest --ignore=confluent-kafka-python\tests\schema_registry --ignore=confluent-kafka-python\tests\integration --import-mode=append confluent-kafka-python\tests || exit /b 1
59+
python -m pytest --ignore=tests\schema_registry --ignore=tests\integration tests || exit /b 1
6060
pip uninstall -y confluent_kafka || exit /b 1
61-
62-
cd %savedir%
6361
)
6462

tox.ini

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,py27,py34,py35,py36
2+
envlist = flake8,py27,py36,py38
33

44
[testenv]
55
setenv =
@@ -11,38 +11,18 @@ passenv =
1111
#http://tox.readthedocs.io/en/latest/config.html#confval-passenv=SPACE-SEPARATED-GLOBNAMES
1212
*
1313
commands =
14-
pip install -v .
15-
py.test -v --timeout 60 --ignore=tmp-build --import-mode append {posargs}
14+
# Install main package and all sub-packages
15+
pip install . .[avro] .[schema-registry] .[json] .[protobuf]
16+
# Early verification that module is loadable
17+
python -c 'import confluent_kafka ; print(confluent_kafka.version())'
18+
# Run tests (large timeout to allow docker image downloads)
19+
python -m pytest --timeout 600 --ignore=tmp-build {posargs}
1620
# See tests/README.md for additional notes on testing
17-
python tests/integration/integration_test.py
21+
#python tests/integration/integration_test.py
1822

19-
[base]
2023
deps =
2124
# https://docs.pytest.org/en/latest/changelog.html#id53
22-
pytest==4.6.4
23-
pytest-timeout
24-
fastavro
25-
requests
26-
27-
[testenv:py27]
28-
deps =
29-
{[base]deps}
30-
avro
31-
32-
[testenv:py34]
33-
deps =
34-
{[base]deps}
35-
avro-python3
36-
37-
[testenv:py35]
38-
deps =
39-
{[base]deps}
40-
avro-python3
41-
42-
[testenv:py36]
43-
deps =
44-
{[base]deps}
45-
avro-python3
25+
-rtests/requirements.txt
4626

4727
[testenv:flake8]
4828
deps = flake8

0 commit comments

Comments
 (0)