From 9d0142e40469be10b470bf269416d66cddbd3256 Mon Sep 17 00:00:00 2001 From: Damian Bodnar Date: Mon, 2 May 2022 17:00:58 +0200 Subject: [PATCH 1/2] Make 4.0.0 work with python3.10 --- README.rst | 4 ++-- VERSION | 2 +- scripts/os_version | 16 ++++++++++++++++ setup.py | 2 +- src/main/aerospike.c | 2 +- src/main/client/truncate.c | 4 ++-- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 3bd37136d..9103bf3e9 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,8 @@ Aerospike Python Client Dependencies ------------ -The Python client for Aerospike works with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8 running on -**64-bit** OS X 10.9+ and Linux. +The Python client for Aerospike works with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 +running on **64-bit** OS X 10.9+ and Linux. NOTE: The following dependencies only apply to installations that build from source on linux, or OS X installations. diff --git a/VERSION b/VERSION index fcdb2e109..1454f6ed4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0 +4.0.1 diff --git a/scripts/os_version b/scripts/os_version index c55424d46..d051057df 100755 --- a/scripts/os_version +++ b/scripts/os_version @@ -124,6 +124,22 @@ main() { distro_short="el${distro_version}" ;; 'ubuntu' ) + case "$distro_version" in + "17"* ) + distro_version="14.04" + ;; + "18"* ) + distro_version="16.04" + ;; + "2"* ) + distro_version="20.04" + ;; + * ) + error "Unsupported linux distibution version: $distro_id $distro_version" + error "Guessing compatibility with Ubuntu 16.04" + distro_version="16.04" + ;; + esac distro_long="${distro_id}${distro_version}" distro_version=${distro_version%.*} distro_short="${distro_id}${distro_version}" diff --git a/setup.py b/setup.py index c6ec492b6..fc312a853 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ os.environ['ARCHFLAGS'] = '-arch x86_64' AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION') if not AEROSPIKE_C_VERSION: - AEROSPIKE_C_VERSION = '4.6.18' + AEROSPIKE_C_VERSION = '4.6.24' DOWNLOAD_C_CLIENT = os.getenv('DOWNLOAD_C_CLIENT') AEROSPIKE_C_HOME = os.getenv('AEROSPIKE_C_HOME') PREFIX = None diff --git a/src/main/aerospike.c b/src/main/aerospike.c index fd085454d..8ae883d9b 100644 --- a/src/main/aerospike.c +++ b/src/main/aerospike.c @@ -95,7 +95,7 @@ AerospikeConstants operator_constants[] = { MOD_INIT(aerospike) { - const char version[8] = "4.0.0"; + const char version[8] = "4.0.1"; // Makes things "thread-safe" PyEval_InitThreads(); int i = 0; diff --git a/src/main/client/truncate.c b/src/main/client/truncate.c index a02059370..b7f7faa6c 100644 --- a/src/main/client/truncate.c +++ b/src/main/client/truncate.c @@ -130,7 +130,7 @@ AerospikeClient_Truncate(AerospikeClient * self, PyObject * args, PyObject * kwd } // Start conversion of the nanosecond parameter - if PyLong_Check(py_nanos) { + if (PyLong_Check(py_nanos)) { temp_long = PyLong_AsLongLong(py_nanos); // There was a negative number outside of the range of - 2 ^ 63 @@ -147,7 +147,7 @@ AerospikeClient_Truncate(AerospikeClient * self, PyObject * args, PyObject * kwd goto CLEANUP; } - } else if PyInt_Check(py_nanos) { + } else if (PyInt_Check(py_nanos)) { long tempInt; tempInt = PyInt_AsLong(py_nanos); From ab5f697c3fc8444405561d97afeb334d346e184b Mon Sep 17 00:00:00 2001 From: Damian Bodnar Date: Thu, 5 May 2022 16:47:20 +0200 Subject: [PATCH 2/2] scripts --- scripts/Dockerfile.build | 11 +++++++++++ scripts/build.sh | 9 +++++++++ scripts/manylinuxbuild.sh | 10 ++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 scripts/Dockerfile.build create mode 100755 scripts/build.sh diff --git a/scripts/Dockerfile.build b/scripts/Dockerfile.build new file mode 100644 index 000000000..67c60925c --- /dev/null +++ b/scripts/Dockerfile.build @@ -0,0 +1,11 @@ +FROM quay.io/pypa/manylinux_2_24_x86_64 + +RUN apt-get update && \ + apt-get install -y libssl-dev; \ + mkdir -p /code + +WORKDIR /code + +CMD /code/scripts/incontainer-build.sh + + diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 000000000..c52acf069 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +git submodule update --init + +docker build -f scripts/Dockerfile.build -t aerospike-wheel-builder:latest . + +docker run -it -v $(pwd):/code aerospike-wheel-builder:latest /code/scripts/manylinuxbuild.sh diff --git a/scripts/manylinuxbuild.sh b/scripts/manylinuxbuild.sh index b48013758..1fef2437a 100755 --- a/scripts/manylinuxbuild.sh +++ b/scripts/manylinuxbuild.sh @@ -1,16 +1,18 @@ #!/bin/bash +set -e + # Compile wheels for PYBIN in /opt/python/*/bin; do - "${PYBIN}/pip" wheel ./ -w /work/tempwheels + "${PYBIN}/pip" wheel ./ -w /code/work/tempwheels done # Bundle external shared libraries into the wheels -for whl in /work/tempwheels/*.whl; do - auditwheel repair "$whl" --plat manylinux2010_x86_64 -w /work/wheels/ +for whl in /code/work/tempwheels/*.whl; do + auditwheel repair "$whl" --plat manylinux_2_24_x86_64 -w /code/work/wheels/ done for PYBIN in /opt/python/*/bin/; do - ${PYBIN}/pip install aerospike -f /work/wheels/ + ${PYBIN}/pip install aerospike -f /code/work/wheels/ --no-index ${PYBIN}/python -c "import aerospike; print('Installed aerospike version{}'.format(aerospike.__version__))" done