diff --git a/g/gradio/build_info.json b/g/gradio/build_info.json index 11c4aac907..14f92e7ace 100644 --- a/g/gradio/build_info.json +++ b/g/gradio/build_info.json @@ -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" }, diff --git a/g/gradio/gradio_gradio@6.9.0_ubi9.7.sh b/g/gradio/gradio_gradio@6.9.0_ubi9.7.sh index ef78e947a9..eaf66e7e5c 100644 --- a/g/gradio/gradio_gradio@6.9.0_ubi9.7.sh +++ b/g/gradio/gradio_gradio@6.9.0_ubi9.7.sh @@ -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 # -------------------------------------------------------