Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions p/pyyaml/build_info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"maintainer": "Harithanagothu2",
"maintainer": "SakshiJain0302",
"package_name": "pyyaml",
"github_url": "https://github.com/yaml/pyyaml",
"version": "6.0.3",
Expand All @@ -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"
Expand Down
105 changes: 105 additions & 0 deletions p/pyyaml/pyyaml_6.0.3_ubi_10.2.sh
Original file line number Diff line number Diff line change
@@ -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 <sakshi.jain16@ibm.com>
#
# 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
Loading