Skip to content

Commit f5f3e05

Browse files
authored
fix: fix docs build error (microsoft#711)
* fix docs build error * delete test code * add comments
1 parent 9a43e15 commit f5f3e05

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.readthedocs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ build:
1010
os: ubuntu-22.04
1111
tools:
1212
python: "3.10"
13+
# During the build process, you need to fetch tags, and since the default command to read the docs only pulls shallow code, it will cause an error.
14+
# So we added the `git fetch --tags --unshallow || true` command to fetch the full tag record.
15+
# Adding this command overrides the default command, so we copied it over to make sure the build was successful.
1316
commands:
17+
- python -mvirtualenv $READTHEDOCS_VIRTUALENV_PATH
18+
- python -m pip install --upgrade --no-cache-dir pip setuptools
19+
- python -m pip install --upgrade --no-cache-dir sphinx
20+
- python -m pip install --exists-action=w --no-cache-dir -r requirements/docs.txt
21+
- python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir .
1422
- git fetch --tags --unshallow || true
23+
- mkdir -p $READTHEDOCS_OUTPUT/html/
24+
- python -m sphinx -T -b html -d _build/doctrees -D language=en ./docs $READTHEDOCS_OUTPUT/html
1525

1626
# Build documentation in the docs/ directory with Sphinx
1727
sphinx:

0 commit comments

Comments
 (0)