[CI/Build] Fix ReadTheDocs build under RTD's seeded pip 23.1 (#6129)

Signed-off-by: Mengjie Zhao <zmj0129@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mjZhaoElaineandClaude Opus 5 authored and GitHub committed 2026-08-13 06:52:01 +08:00
1 parent 12f8168179
commit 9a59475015
1 file changed
+7 -2
+7 -2
View File
@@ -11,10 +11,15 @@ build:
post_checkout: post_checkout:
- git fetch --unshallow || true - git fetch --unshallow || true
pre_install: pre_install:
# `pre_install` runs before RTD upgrades pip, and the seeded pip 23.1
# rejects the `typing_extensions` wheel torch needs (fixed in pip 23.2).
- python -m pip install --upgrade pip
# Pre-install CPU torch so the subsequent `pip install .[docs]` does not # Pre-install CPU torch so the subsequent `pip install .[docs]` does not
# pull ~2 GB of CUDA 13 libs (cuBLAS/cuDNN/NCCL/...) that exceed RTD's # pull ~2 GB of CUDA 13 libs (cuBLAS/cuDNN/NCCL/...) that exceed RTD's
# 1 GB memory cap and time out the mkdocs build. # 1 GB memory cap and time out the mkdocs build. Wheel-only: `--index-url`
- python -m pip install --index-url https://download.pytorch.org/whl/cpu torch # replaces PyPI, so an sdist fallback cannot reach its build deps. The
# quotes keep YAML from reading `:all:` as a mapping key.
- "python -m pip install --only-binary=:all: --index-url https://download.pytorch.org/whl/cpu torch"
mkdocs: mkdocs:
configuration: mkdocs.yml configuration: mkdocs.yml