Skip to content

Commit 5661988

Browse files
rtfd: building on PRs only (#17086)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 551f64d commit 5661988

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.readthedocs.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
# Required
2020
version: 2
2121

22+
submodules:
23+
include: all
24+
recursive: true
25+
2226
# Build documentation in the docs/ directory with Sphinx
2327
# reference: https://docs.readthedocs.io/en/stable/config-file/v2.html#sphinx
2428
sphinx:
@@ -28,6 +32,18 @@ build:
2832
os: ubuntu-20.04
2933
tools:
3034
python: "3.9"
35+
apt_packages:
36+
- texlive-latex-extra
37+
- dvipng
38+
- texlive-pictures
3139
commands:
32-
- ls -lh .
33-
- mkdir -p _readthedocs/html
40+
- printenv
41+
- pwd ; ls -lh
42+
- >
43+
pip install -U pip ;
44+
pip install -e . -q -r requirements/pytorch/docs.txt \
45+
-f 'https://download.pytorch.org/whl/cpu/torch_stable.html' ;
46+
pip list
47+
# this need to be split so `sphinx-build` is picked from previous installation
48+
- bash docs/rtfd-build.sh
49+
- mkdir -p _readthedocs ; mv docs/build/html _readthedocs/html

docs/rtfd-build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# building for PRs and skip stable and latest states
2+
3+
if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ];
4+
then
5+
cd ./docs/source-pytorch ;
6+
export PL_FAST_DOCS_DEV=1 ;
7+
make html --jobs $(nproc) ;
8+
ls -lh ../build
9+
else
10+
echo "Void build... :-]" ;
11+
mkdir -p ./docs/build/html
12+
fi

0 commit comments

Comments
 (0)