Skip to content
Merged
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
28 changes: 25 additions & 3 deletions ci_scripts/gendoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,31 @@ export DOCROOT

# install paddle if not installed yet.
# PADDLE_WHL is defined in ci_start.sh
pip3 list --disable-pip-version-check | grep paddlepaddle > /dev/null
if [ $? -ne 0 ] ; then
pip3 install --no-cache-dir -q --progress-bar off -i https://pypi.tuna.tsinghua.edu.cn/simple ${PADDLE_WHL}
if ! pip3 list --disable-pip-version-check | grep paddlepaddle; then
echo "Paddle is not found, attempting to install from ${PADDLE_WHL}..."

# Install logic:
# - If PADDLE_WHL is a .whl file URL: download and install locally
# - Otherwise: install directly via pip (supports package names and other URLs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

话说 pip 也支持 url 呀,为什么要分开处理呢?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当时我看见这个耗时很离谱,就想先下载下来看看试试(感觉 wget 网络请求可能比 pip 处理的好

43f5f1b0dd74ceccc4bc1f7df3ffc553

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯可以

if [[ "${PADDLE_WHL}" == *.whl ]]; then
echo "Downloading wheel file: ${PADDLE_WHL}"
wget -q ${PADDLE_WHL} -O /tmp/paddle.whl
if [ $? -ne 0 ]; then
echo -e "\e[31mError: Failed to download wheel file from ${PADDLE_WHL}\e[0m"
exit 1
fi
echo "Installing local wheel file..."
pip3 install --no-cache-dir -q --progress-bar off -i https://pypi.tuna.tsinghua.edu.cn/simple /tmp/paddle.whl
else
echo "Using pip install directly..."
pip3 install --no-cache-dir -q --progress-bar off -i https://pypi.tuna.tsinghua.edu.cn/simple ${PADDLE_WHL}
fi

if [ $? -ne 0 ]; then
echo -e "\e[31mError: Failed to install paddle from ${PADDLE_WHL}\e[0m"
exit 1
fi
echo "Paddle installed successfully."
fi


Expand Down