Skip to content

Commit 1ec9f1b

Browse files
committed
refine code
1 parent bbd8d2e commit 1ec9f1b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

ci_scripts/gendoc.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ export DOCROOT
1717
# PADDLE_WHL is defined in ci_start.sh
1818
if ! pip3 list --disable-pip-version-check | grep paddlepaddle; then
1919
echo "Paddle is not found, attempting to install from ${PADDLE_WHL}..."
20-
pip3 install --no-cache-dir -q --progress-bar off -i https://pypi.tuna.tsinghua.edu.cn/simple ${PADDLE_WHL}
20+
21+
# Install logic:
22+
# - If PADDLE_WHL is a .whl file URL: download and install locally
23+
# - Otherwise: install directly via pip (supports package names and other URLs)
24+
if [[ "${PADDLE_WHL}" == *.whl ]]; then
25+
echo "Downloading wheel file: ${PADDLE_WHL}"
26+
wget -q ${PADDLE_WHL} -O /tmp/paddle.whl
27+
if [ $? -ne 0 ]; then
28+
echo -e "\e[31mError: Failed to download wheel file from ${PADDLE_WHL}\e[0m"
29+
exit 1
30+
fi
31+
echo "Installing local wheel file..."
32+
pip3 install --no-cache-dir -q --progress-bar off /tmp/paddle.whl
33+
else
34+
echo "Using pip install directly..."
35+
pip3 install --no-cache-dir -q --progress-bar off -i https://pypi.tuna.tsinghua.edu.cn/simple ${PADDLE_WHL}
36+
fi
37+
2138
if [ $? -ne 0 ]; then
2239
echo -e "\e[31mError: Failed to install paddle from ${PADDLE_WHL}\e[0m"
2340
exit 1

0 commit comments

Comments
 (0)