Skip to content

Commit

Permalink
rtfd: building on PRs only (#17086)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] committed Mar 15, 2023
1 parent 551f64d commit 5661988
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
# Required
version: 2

submodules:
include: all
recursive: true

# Build documentation in the docs/ directory with Sphinx
# reference: https://docs.readthedocs.io/en/stable/config-file/v2.html#sphinx
sphinx:
Expand All @@ -28,6 +32,18 @@ build:
os: ubuntu-20.04
tools:
python: "3.9"
apt_packages:
- texlive-latex-extra
- dvipng
- texlive-pictures
commands:
- ls -lh .
- mkdir -p _readthedocs/html
- printenv
- pwd ; ls -lh
- >
pip install -U pip ;
pip install -e . -q -r requirements/pytorch/docs.txt \
-f 'https://download.pytorch.org/whl/cpu/torch_stable.html' ;
pip list
# this need to be split so `sphinx-build` is picked from previous installation
- bash docs/rtfd-build.sh
- mkdir -p _readthedocs ; mv docs/build/html _readthedocs/html
12 changes: 12 additions & 0 deletions docs/rtfd-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# building for PRs and skip stable and latest states

if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ];
then
cd ./docs/source-pytorch ;
export PL_FAST_DOCS_DEV=1 ;
make html --jobs $(nproc) ;
ls -lh ../build
else
echo "Void build... :-]" ;
mkdir -p ./docs/build/html
fi

0 comments on commit 5661988

Please sign in to comment.