diff --git a/p/pyyaml/build_info.json b/p/pyyaml/build_info.json index c84593229d..e7ab864fe1 100644 --- a/p/pyyaml/build_info.json +++ b/p/pyyaml/build_info.json @@ -1,5 +1,5 @@ { - "maintainer": "Harithanagothu2", + "maintainer": "SakshiJain0302", "package_name": "pyyaml", "github_url": "https://github.com/yaml/pyyaml", "version": "6.0.3", @@ -14,10 +14,13 @@ "build_script":"pyyaml_ubi_9.3.sh" }, "6.*": { - "build_script":"pyyaml_6.0_ubi_9.3.sh" + "build_script": [ + "pyyaml_6.0_ubi_9.3.sh", + "pyyaml_6.0.3_ubi_10.2.sh" + ] }, "5.*": { - "build_script":"pyyaml_6.0_ubi_9.3.sh" + "build_script":"pyyaml_6.0_ubi_9.3.sh" }, "*": { "build_script":"pyyaml_ubi_9.3.sh" diff --git a/p/pyyaml/pyyaml_6.0.3_ubi_10.2.sh b/p/pyyaml/pyyaml_6.0.3_ubi_10.2.sh new file mode 100644 index 0000000000..f670035783 --- /dev/null +++ b/p/pyyaml/pyyaml_6.0.3_ubi_10.2.sh @@ -0,0 +1,105 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : pyyaml +# Version : 6.0.3 +# Source repo : https://github.com/yaml/pyyaml +# Tested on : UBI:10.2 +# Language : Python +# Ci-Check : True +# Script License: Apache License, Version 2 or later +# Maintainer : Sakshi Jain +# +# 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=pyyaml +PACKAGE_VERSION=${1:-"6.0.3"} +PACKAGE_URL=https://github.com/yaml/pyyaml.git + +yum install -y git python3.14 python3.14-devel.ppc64le libyaml-devel gcc gcc-c++ + +python3.14 -m ensurepip --upgrade +python3.14 -m pip install --upgrade pip setuptools wheel + +# ----- Choose correct Cython automatically ----- +PYVER=$(python3.14 - << 'EOF' +import sys +print(f"{sys.version_info.major}.{sys.version_info.minor}") +EOF +) +if [[ "$PYVER" == "3.13" || "$PYVER" == "3.14" ]]; then + python3.14 -m pip install "cython>=3.0" wheel pytest +else + python3.14 -m pip install "cython<3.0.0" wheel pytest +fi + + +PATH=$PATH:/usr/local/bin/ + +git clone $PACKAGE_URL $PACKAGE_NAME +cd $PACKAGE_NAME +git checkout $PACKAGE_VERSION + +# ----- Apply patch ONLY for Python 3.13/3.14 ----- +if [[ "$PYVER" == "3.13" || "$PYVER" == "3.14" ]]; then + +cat << 'EOF' > patch_yaml_yaml_py313.patch +diff --git a/yaml/_yaml.pyx b/yaml/_yaml.pyx +index 1b2c3f1..a8d9d42 100644 +--- a/yaml/_yaml.pyx ++++ b/yaml/_yaml.pyx +@@ -1,6 +1,13 @@ + # cython: freethreading_compatible = True + + import yaml ++ ++# === Python 3.13 + Cython 3 compatibility imports === ++cdef extern from "string.h": ++ void *memcpy(void *dest, const void *src, size_t n) ++ ++from cpython.bytes cimport PyBytes_AS_STRING, PyBytes_GET_SIZE ++# ================================================ + + def get_version_string(): + cdef const char *value +EOF + +echo "Applying Python 3.13+ compatibility patch..." +git apply patch_yaml_yaml_py313.patch + +fi + +# Build wheel +if ! python3.14 -m pip wheel . --no-deps -w dist ; then + echo "------------------$PACKAGE_NAME:Build_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails" + exit 1 +fi + +# Install the generated wheel +if ! python3.14 -m pip install --force-reinstall dist/*.whl ; 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 + +# Run tests +if ! pytest ; 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:Build_Install_&_Test_success----------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Build_Install_and_Test_Success" + exit 0 +fi \ No newline at end of file