Skip to content
Merged
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
2 changes: 1 addition & 1 deletion g/gradio/build_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"default_branch": "main",
"package_dir": "g/gradio",
"build_script": "gradio_gradio@6.9.0_ubi9.7.sh",
"wheel_build" : true,
"validate_build_script": true,
"use_non_root_user": false,
"docker_build": false,
"wheel_build" : true,
"gradio@06.9.0": {
"build_script": "gradio_gradio@6.9.0_ubi9.7.sh"
},
Expand Down
57 changes: 18 additions & 39 deletions g/gradio/gradio_gradio@6.9.0_ubi9.7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,63 +100,42 @@ if ! pnpm -r \
fi

# -------------------------------------------------------
# Install the Python package
# -------------------------------------------------------
echo "Installing Gradio Python package..."

if ! pip3.12 install .; then
echo "------------------ ${PACKAGE_NAME}: Python Install Failed ------------------"
exit 1
fi

# -------------------------------------------------------
# Remove ODbL-licensed files (REQUIRED FOR COMPLIANCE)
# Remove ODbL-licensed files BEFORE packaging
# -------------------------------------------------------
echo "=========================================="
echo "Removing ODbL-licensed files..."
echo "=========================================="

# Find where gradio is installed
GRADIO_PATH=$(python3.12 -c "import gradio, os; print(os.path.dirname(gradio.__file__))")
echo "Gradio installed at: $GRADIO_PATH"
FRONTEND_ASSETS="${BUILD_HOME}/${PACKAGE_NAME}/gradio/templates/frontend/assets"

ASSETS_DIR="$GRADIO_PATH/templates/frontend/assets"

if [ -d "$ASSETS_DIR" ]; then
REMOVED=0

# Remove PlotlyPlot-CIlapRFP.js
if [ -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js" ]; then
rm -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js"
echo "✓ Removed PlotlyPlot-CIlapRFP.js"
REMOVED=$((REMOVED + 1))
fi

# Remove PlotlyPlot-CIlapRFP.js.map
if [ -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js.map" ]; then
rm -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js.map"
echo "✓ Removed PlotlyPlot-CIlapRFP.js.map"
REMOVED=$((REMOVED + 1))
fi
if [ -d "$FRONTEND_ASSETS" ]; then
# Remove PlotlyPlot files (handles any hash in filename)
rm -f "$FRONTEND_ASSETS"/PlotlyPlot-*.js "$FRONTEND_ASSETS"/PlotlyPlot-*.js.map

# Verify removal
if [ -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js" ] || [ -f "$ASSETS_DIR/PlotlyPlot-CIlapRFP.js.map" ]; then
if ls "$FRONTEND_ASSETS"/PlotlyPlot*.js* 2>/dev/null; then
echo "ERROR: Failed to remove ODbL files!"
exit 1
fi

if [ $REMOVED -eq 2 ]; then
echo "✓ Successfully removed 2 ODbL-licensed files"
else
echo "WARNING: Expected to remove 2 files, removed $REMOVED"
fi
echo "✓ ODbL files removed successfully"
else
echo "ERROR: Assets directory not found: $ASSETS_DIR"
echo "ERROR: Assets directory not found: $FRONTEND_ASSETS"
exit 1
fi

echo "=========================================="

# -------------------------------------------------------
# Install the Python package
# -------------------------------------------------------
echo "Installing Gradio Python package..."

if ! pip3.12 install .; then
echo "------------------ ${PACKAGE_NAME}: Python Install Failed ------------------"
exit 1
fi

# -------------------------------------------------------
# Run unit tests
# -------------------------------------------------------
Expand Down