Skip to content

Commit cedb291

Browse files
committed
Depend on Python3 instead of EOL Python2 (#2829)
1 parent 43a5a3e commit cedb291

28 files changed

+39
-39
lines changed

.doozer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"buildenv": "xenial-amd64",
66
"builddeps": [
77
"build-essential",
8-
"python",
8+
"python3",
99
"zlib1g-dev",
1010
"libssl-dev",
1111
"libsasl2-dev",
@@ -26,7 +26,7 @@
2626
"buildenv": "xenial-i386",
2727
"builddeps": [
2828
"build-essential",
29-
"python",
29+
"python3",
3030
"zlib1g-dev",
3131
"libssl-dev",
3232
"libsasl2-dev",
@@ -48,7 +48,7 @@
4848
"buildenv": "xenial-armhf",
4949
"builddeps": [
5050
"build-essential",
51-
"python",
51+
"python3",
5252
"zlib1g-dev",
5353
"libssl-dev",
5454
"libsasl2-dev",
@@ -71,7 +71,7 @@
7171
"buildenv": "stretch-mips",
7272
"builddeps": [
7373
"build-essential",
74-
"python",
74+
"python3",
7575
"zlib1g-dev",
7676
"libssl-dev",
7777
"libsasl2-dev",
@@ -94,7 +94,7 @@
9494
"buildenv": "xenial-amd64",
9595
"builddeps": [
9696
"build-essential",
97-
"python",
97+
"python3",
9898
"zlib1g-dev",
9999
"libssl-dev",
100100
"libsasl2-dev",

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
addons:
1111
apt:
1212
packages:
13+
- python3
14+
- python3-pip
15+
- python3-setuptools
1316
# required by openssl installer
1417
- perl
1518

@@ -65,7 +68,7 @@ matrix:
6568
before_script:
6669
- wget -O rapidjson-dev.deb https://launchpad.net/ubuntu/+archive/primary/+files/rapidjson-dev_1.1.0+dfsg2-3_all.deb
6770
- sudo dpkg -i rapidjson-dev.deb
68-
- sudo pip install -r tests/requirements.txt
71+
- sudo pip3 install -r tests/requirements.txt
6972
- sudo apt update
7073
- sudo apt install -y doxygen graphviz gdb
7174
- ./configure --install-deps --disable-lz4-ext --prefix="$PWD/dest"

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DOC_FILES+= LICENSE LICENSES.txt INTRODUCTION.md README.md \
88
CONFIGURATION.md STATISTICS.md
99

1010
PKGNAME?= librdkafka
11-
VERSION?= $(shell python packaging/get_version.py src/rdkafka.h)
11+
VERSION?= $(shell python3 packaging/get_version.py src/rdkafka.h)
1212

1313
# Jenkins CI integration
1414
BUILD_NUMBER ?= 1

configure.self

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ void foo (void) {
264264
mkl_mkvar_set SYMDUMPER SYMDUMPER 'echo'
265265
fi
266266

267-
# The linker-script generator (lds-gen.py) requires python
267+
# The linker-script generator (lds-gen.py) requires python3
268268
if [[ $WITH_LDS == y ]]; then
269-
if ! mkl_command_check python "HAVE_PYTHON" "disable" "python -V"; then
270-
mkl_err "disabling linker-script since python is not available"
269+
if ! mkl_command_check python3 "HAVE_PYTHON" "disable" "python3 -V"; then
270+
mkl_err "disabling linker-script since python3 is not available"
271271
mkl_mkvar_set WITH_LDS WITH_LDS "n"
272272
fi
273273
fi

debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Source: librdkafka
22
Priority: optional
33
Maintainer: Faidon Liambotis <paravoid@debian.org>
44
Uploaders: Christos Trochalakis <ctrochalakis@debian.org>
5-
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, liblz4-dev, python
5+
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, liblz4-dev, python3
66
Standards-Version: 3.9.7
77
Section: libs
88
Homepage: https://github.com/edenhill/librdkafka

lds-gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# librdkafka - Apache Kafka C library
44
#

packaging/RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ On a Linux host with docker installed, this will also require S3 credentials
138138
to be set up.
139139

140140
$ cd packaging/nuget
141-
$ pip install -r requirements.txt # if necessary
141+
$ pip3 install -r requirements.txt # if necessary
142142
$ ./release.py v0.11.1-RC1
143143

144144
Test the generated librdkafka.redist.0.11.1-RC1.nupkg and

packaging/alpine/build-alpine.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ "$1" = "--in-docker" ]; then
99
# Runs in docker, performs the actual build.
1010
shift
1111

12-
apk add bash curl gcc g++ make musl-dev bsd-compat-headers git python perl
12+
apk add bash curl gcc g++ make musl-dev bsd-compat-headers git python3 perl
1313

1414
git clone /v /librdkafka
1515

packaging/archlinux/PKGBUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ arch=('x86_64')
88
source=('git+https://github.com/edenhill/librdkafka#branch=master')
99
sha256sums=('SKIP')
1010
depends=(glibc libsasl lz4 openssl zlib zstd)
11-
makedepends=(bash git python)
11+
makedepends=(bash git python3)
1212

1313
pkgver() {
1414
cd "$pkgname"

packaging/debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: librdkafka
22
Priority: optional
33
Maintainer: Faidon Liambotis <paravoid@debian.org>
4-
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, python
4+
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, python3
55
Standards-Version: 3.9.6
66
Section: libs
77
Homepage: https://github.com/edenhill/librdkafka

packaging/debian/librdkafka.dsc

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Homepage: https://github.com/edenhill/librdkafka
88
Standards-Version: 3.9.6
99
Vcs-Browser: https://github.com/edenhill/librdkafka/tree/master
1010
Vcs-Git: git://github.com/edenhill/librdkafka.git -b master
11-
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, python
11+
Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libsasl2-dev, python3
1212
Package-List:
1313
librdkafka-dev deb libdevel optional arch=any
1414
librdkafka1 deb libs optional arch=any

packaging/get_version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import sys
44

@@ -18,4 +18,4 @@
1818
patch = int(version[6:8], 16)
1919
version = '.'.join(str(item) for item in (major, minor, patch))
2020

21-
print version
21+
print(version)

packaging/nuget/artifact.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# Collects CI artifacts from S3 storage, downloading them

packaging/nuget/packaging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# NuGet packaging script.
44
# Assembles a NuGet package using CI artifacts in S3

packaging/nuget/release.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# NuGet release packaging tool.

packaging/nuget/zfile/zfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import os
44
import tarfile

packaging/rpm/librdkafka.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ License: BSD-2-Clause
99
URL: https://github.com/edenhill/librdkafka
1010
Source: librdkafka-%{version}.tar.gz
1111

12-
BuildRequires: zlib-devel libstdc++-devel gcc >= 4.1 gcc-c++ openssl-devel cyrus-sasl-devel python
12+
BuildRequires: zlib-devel libstdc++-devel gcc >= 4.1 gcc-c++ openssl-devel cyrus-sasl-devel python3
1313
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
1414

1515
%define _source_payload w9.gzdio

packaging/rpm/mock-on-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [[ ! -f /.dockerenv ]]; then
2828

2929
else
3030

31-
yum install -y python mock make git
31+
yum install -y python3 mock make git
3232

3333
cfg_file=/etc/mock/${MOCK_CONFIG}.cfg
3434
ls -la /etc/mock

packaging/tools/build-debian.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525
set -u
2626

2727
apt-get update
28-
apt-get install -y gcc g++ zlib1g-dev python2.7 git-core make
28+
apt-get install -y gcc g++ zlib1g-dev python3 git-core make
2929

3030

3131
# Copy the librdkafka git archive to a new location to avoid messing

packaging/tools/gh-release-checksums.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Calculate checksums for GitHub release artifacts/assets.
44
#

tests/LibrdkafkaTestApp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# librdkafka test trivup app module
44
#

tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ to alternate directory, e.g., `TRIVUP_ROOT=$HOME/trivup make full`.
2525

2626
First install trivup:
2727

28-
$ pip install trivup
28+
$ pip3 install trivup
2929

3030
Bring up a Kafka cluster (with the specified version) and start an interactive
3131
shell, when the shell is exited the cluster is brought down and deleted.

tests/autotest.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pushd tests
2121
source _venv/bin/activate
2222

2323
# Install trivup that is used to bring up a cluster.
24-
pip install -U trivup
24+
pip3 install -U trivup
2525

2626
# Run tests that automatically spin up their clusters
2727
export KAFKA_VERSION

tests/broker_version_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# Run librdkafka regression tests on with different SASL parameters

tests/cluster_testing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# Cluster testing helper

tests/interactive_broker_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# Run librdkafka regression tests on different supported broker versions.

tests/performance_plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33

44
import sys, json

tests/sasl_test.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
#
44
# Run librdkafka regression tests on with different SASL parameters
@@ -11,9 +11,6 @@
1111
from cluster_testing import LibrdkafkaTestCluster, print_report_summary, print_test_report_summary, read_scenario_conf
1212
from LibrdkafkaTestApp import LibrdkafkaTestApp
1313

14-
15-
import time
16-
import tempfile
1714
import os
1815
import sys
1916
import argparse
@@ -225,7 +222,7 @@ def handle_report (report, version, suite):
225222
else:
226223
tests_to_run = tests
227224
report = test_it(version, tests=tests_to_run, conf=_conf, rdkconf=_rdkconf,
228-
debug=args.debug, scenario=scenario)
225+
debug=args.debug, scenario=args.scenario)
229226

230227
# Handle test report
231228
report['version'] = version

0 commit comments

Comments
 (0)