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
11 changes: 7 additions & 4 deletions m/matplotlib/build_info.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{
"maintainer": "kiranNukal",
"maintainer": "Ryder Salinas <rbsalinas@ibm.com>",
"package_name": "matplotlib",
"github_url": "https://github.com/matplotlib/matplotlib.git",
"version": "v3.10.3",
"version": "v3.11.0",
"wheel_build" : true,
"default_branch": "main",
"package_dir": "m/matplotlib",
"build_script": "matplotlib_ubi_9.3.sh",
"build_script": "matplotlib_3.11.0_ubi_9.6.sh",
"validate_build_script": true,
"use_non_root_user": false,
"docker_build": false,
"v3.7.1,v3.8.0":{
"build_script":"matplotlib_3.8.0_ubi_9.3.sh"
},
"v3.11.0":{
"build_script":"matplotlib_3.11.0_ubi_9.6.sh"
},
"*": {
"build_script": "matplotlib_ubi_9.3.sh"
"build_script":"matplotlib_3.11.0_ubi_9.6.sh"
}
}

106 changes: 106 additions & 0 deletions m/matplotlib/matplotlib_3.11.0_ubi_9.6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash -e
# -----------------------------------------------------------------------------
#
# Package : matplotlib
# Version : v3.11.0
# Source repo : https://github.com/matplotlib/matplotlib.git
# Tested on : UBI 9.6
# Language : Python, C++, Jupyter Notebook
# Ci-Check : True
# Script License: Apache License, Version 2 or later
# Maintainer : Ryder Salinas <rbsalinas@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="matplotlib"
PACKAGE_VERSION=${1:-3.11.0}
CURRENT_DIR="$(pwd)"

echo "Building ${PACKAGE_NAME} ${PACKAGE_VERSION}"

# -- System dependencies ------------------------------------------------------
dnf install -y \
gcc-toolset-13 \
git \
python3.12 \
python3.12-devel \
python3.12-pip \
libjpeg-turbo-devel \
zlib-devel \
libpng-devel \
freetype-devel \
lcms2-devel \
libtiff-devel \
libwebp-devel \
openjpeg2-devel

export PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH"
gcc --version

# Compiler hints — help Pillow's setup.py locate system image headers
export CFLAGS="-I/usr/include"
export LDFLAGS="-L/usr/lib64"

python3.12 -m pip install --upgrade pip setuptools

# -- Build wheel --------------------------------------------------------------
python3.12 -m pip wheel --no-cache-dir --only-binary :none "${PACKAGE_NAME}==${PACKAGE_VERSION}" -w "${CURRENT_DIR}/dist/"

WHEEL=$(find "${CURRENT_DIR}/dist" -name "${PACKAGE_NAME}-*.whl" | head -1)
if [ -z "$WHEEL" ]; then
echo "ERROR: wheel not found after build"
exit 1
fi
echo "Wheel: $WHEEL"

# -- Install ------------------------------------------------------------------
python3.12 -m pip install "$WHEEL"

# -- Tests --------------------------------------------------------------------
python3.12 - << 'PYEOF'
import sys

# 1. Import and version check
import matplotlib
assert matplotlib.__version__ == "3.11.0", f"Unexpected version: {matplotlib.__version__}"
print(f"PASS import matplotlib {matplotlib.__version__}")

# 2. C extension sanity check
import matplotlib._c_internal_utils
print("PASS C extension loaded")

# 3. Headless render — no display required
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import io

fig, ax = plt.subplots()
ax.plot(np.linspace(0, 2 * np.pi, 100), np.sin(np.linspace(0, 2 * np.pi, 100)))
ax.set_title("smoke test")
buf = io.BytesIO()
fig.savefig(buf, format="png")
plt.close(fig)
assert buf.tell() > 0
print("PASS headless PNG render")

# 4. Key sub-packages importable
import matplotlib.pyplot
import matplotlib.patches
import matplotlib.colors
import matplotlib.ticker
import matplotlib.dates
print("PASS key sub-packages importable")

print("\nAll tests passed.")
sys.exit(0)
PYEOF

echo "Build and tests complete. Wheel: $WHEEL"
Loading