From 90ecff734e4d77d0f8c6d04094877913b17b18b4 Mon Sep 17 00:00:00 2001 From: Varsha Kumar Date: Thu, 23 Jul 2026 18:33:42 +0000 Subject: [PATCH] Add buildscript for cassandra-driver 3.30.1 for UBI 9.6 Signed-off-by: Varsha Kumar --- c/cassandra-driver/build_info.json | 19 +++-- .../cassandra-driver_3.30.1_ubi_9.6.sh | 82 +++++++++++++++++++ 2 files changed, 96 insertions(+), 5 deletions(-) create mode 100755 c/cassandra-driver/cassandra-driver_3.30.1_ubi_9.6.sh diff --git a/c/cassandra-driver/build_info.json b/c/cassandra-driver/build_info.json index 78e681f3e8..1c5a0b17af 100644 --- a/c/cassandra-driver/build_info.json +++ b/c/cassandra-driver/build_info.json @@ -1,13 +1,22 @@ { - "maintainer": "ramnathnayak-ibm", + "maintainer": "Varsha Kumar", "package_name": "cassandra-driver", - "github_url": "http://github.com/datastax/python-driver", - "version": "3.29.0", + "github_url": "https://github.com/apache/cassandra-python-driver", + "version": "3.30.1", "default_branch": "master", - "build_script": "cassandra-driver_ubi_9.3.sh", + "build_script": "cassandra-driver_3.30.1_ubi_9.6.sh", "package_dir": "c/cassandra-driver", "docker_build": false, "wheel_build": true, "validate_build_script": true, - "use_non_root_user": false + "use_non_root_user": false, + "3.30.1":{ + "build_script": "cassandra-driver_3.30.1_ubi_9.6.sh" + }, + "3.29.0":{ + "build_script": "cassandra-driver_ubi_9.3.sh" + }, + "*": { + "build_script": "cassandra-driver_3.30.1_ubi_9.6.sh" + } } diff --git a/c/cassandra-driver/cassandra-driver_3.30.1_ubi_9.6.sh b/c/cassandra-driver/cassandra-driver_3.30.1_ubi_9.6.sh new file mode 100755 index 0000000000..e8da7eaa9a --- /dev/null +++ b/c/cassandra-driver/cassandra-driver_3.30.1_ubi_9.6.sh @@ -0,0 +1,82 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : cassandra-driver +# Version : 3.30.1 +# Source repo : https://github.com/apache/cassandra-python-driver +# Tested on : UBI:9.6 +# Language : Python +# Ci-Check : True +# Script License : Apache License, Version 2 or later +# Maintainer : Varsha Kumar +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# ---------------------------------------------------------------------------- +PACKAGE_NAME=cassandra-driver +PACKAGE_VERSION=${1:-3.30.1} +PACKAGE_URL=https://github.com/apache/cassandra-python-driver +PACKAGE_DIR=cassandra-python-driver + +# Install dependencies +yum install -y git gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ gcc-toolset-13-gcc-gfortran make wget sudo openssl-devel bzip2-devel krb5-devel libffi-devel zlib-devel python3.13 python3.13-devel cargo rust +python3.13 -m ensurepip --upgrade +export PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH +export LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:$LD_LIBRARY_PATH + +#Install libev +curl -LO https://dist.schmorp.de/libev/Attic/libev-4.33.tar.gz +tar -xzf libev-4.33.tar.gz +cd libev-4.33 +export CFLAGS="-fPIC" +export LDFLAGS="-fPIC" +./configure --disable-shared --enable-static +make -j$(nproc) +make install +cd .. + +# Clone the repository +git clone $PACKAGE_URL +cd $PACKAGE_DIR +git checkout $PACKAGE_VERSION + +#install necessary Python packages +python3.13 -m pip install wheel pytest tox nox mock build gevent eventlet pyopenssl "setuptools<80" +python3.13 -m pip install -r test-requirements.txt + +export CASS_DRIVER_LIBEV_INCLUDES="/usr/local/include" +export CASS_DRIVER_LIBEV_LIBS="/usr/local/lib" +export LDFLAGS="-Wl,-Bstatic -lev -Wl,-Bdynamic" +python3.13 setup.py build_ext --inplace + +#Install +if ! python3.13 -m pip install . --no-build-isolation ; then + echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails" + exit 1 +fi + +#Skipping some tests as these are parity with intel and some test dependencies are deprecated with python3.11 and python3.12 +if ! python3.13 -m pytest tests/unit/ \ + -k "not (CloudTests or TestTwistedConnection or _PoolTests or test_timeout_does_not_release_stream_id)" \ + --ignore=tests/unit/io/test_libevreactor.py \ + --ignore=tests/unit/io/test_asyncioreactor.py \ + --ignore=tests/unit/io/test_asyncorereactor.py \ + --ignore=tests/unit/cython/test_bytesio.py \ + --ignore=tests/unit/cython/test_types.py \ + --ignore=tests/unit/cython/test_utils.py -p no:warnings ; then + echo "------------------$PACKAGE_NAME:install_success_but_test_fails---------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails" + exit 2 +else + echo "------------------$PACKAGE_NAME:install_&_test_both_success-------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success" + exit 0 +fi \ No newline at end of file