forked from Lightning-AI/pytorch-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: build docs for specific tags (Lightning-AI#17055)
Co-authored-by: Adrian Wälchli <[email protected]>
- Loading branch information
Showing
4 changed files
with
85 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
# Usage: | ||
# 1. Generate docs with one or more specified versions: | ||
# $ export PACKAGE_NAME=app | ||
# $ bash docs/generate_docs_for_tags.sh 1.9.3 1.9.2 1.9.1 1.9.0 | ||
# OR | ||
# $ PACKAGE_NAME=pytorch bash docs/generate_docs_for_tags.sh 1.8.6 1.8.5 1.8.4 1.8.3 1.8.2 1.8.1 1.8.0 | ||
set -e | ||
|
||
PATH_ROOT=~/Desktop/builds | ||
PATH_ENV=$PATH_ROOT/venv-docs-$PACKAGE_NAME | ||
# export PACKAGE_NAME=app | ||
export FREEZE_REQUIREMENTS=1 | ||
|
||
echo PATH_ROOT: $PATH_ROOT | ||
echo PATH_ENV: $PATH_ENV | ||
echo PYTHONPATH: $PYTHONPATH | ||
|
||
function build_docs { | ||
python --version | ||
pip --version | ||
|
||
pip install -q setuptools wheel python-multipart | ||
pip install -e . -q -r requirements/$PACKAGE_NAME/docs.txt \ | ||
-f ../pypi -f https://download.pytorch.org/whl/cpu/torch_stable.html | ||
pip list | ||
|
||
cd docs/source-$PACKAGE_NAME | ||
make html --jobs=$(nproc) | ||
# make html SPHINXOPTS="-W --keep-going" --jobs=$(nproc) | ||
cd ../.. | ||
|
||
mkdir -p $PATH_ROOT/docs-${PACKAGE_NAME} | ||
mv docs/build/html $PATH_ROOT/docs-${PACKAGE_NAME}/$tag | ||
} | ||
|
||
# iterate over all arguments assuming that each argument is version | ||
for tag in "$@" | ||
do | ||
echo processing version: $tag | ||
|
||
# Don't install/update anything before activating venv | ||
# to avoid breaking any existing environment. | ||
python -m venv $PATH_ENV | ||
source $PATH_ENV/bin/activate | ||
|
||
cd $PATH_ROOT | ||
git clone --single-branch --branch $tag --depth 1 --recurse-submodules \ | ||
https://github.com/Lightning-AI/lightning.git | ||
cd lightning | ||
|
||
build_docs > "$PATH_ROOT/building-${PACKAGE_NAME}_${tag}.log" | ||
|
||
cd .. | ||
rm -rf lightning | ||
|
||
deactivate | ||
rm -rf $PATH_ENV | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters