Skip to content

Commit

Permalink
docs: validate pinning version, post #2435
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 19, 2024
1 parent 905252b commit c94aadb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
TOKENIZERS_PARALLELISM: false
SPHINX_MOCK_REQUIREMENTS: 0
SPHINX_FETCH_ASSETS: 0
SPHINX_PIN_RELEASE_VERSIONS: 1

jobs:
docs-make:
Expand Down Expand Up @@ -69,9 +70,7 @@ jobs:
- name: Full build for deployment
if: github.event_name != 'pull_request'
run: |
echo "SPHINX_FETCH_ASSETS=1" >> $GITHUB_ENV
echo "SPHINX_PIN_RELEASE_VERSIONS=1" >> $GITHUB_ENV
run: echo "SPHINX_FETCH_ASSETS=1" >> $GITHUB_ENV
- name: make ${{ matrix.target }}
working-directory: ./docs
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
Expand Down
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import lai_sphinx_theme
import torchmetrics
from lightning_utilities.docs import adjust_linked_external_docs, fetch_external_assets
from lightning_utilities.docs.formatting import _transform_changelog

_PATH_HERE = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -78,6 +77,8 @@ def _set_root_image_path(page_path: str) -> None:


if SPHINX_FETCH_ASSETS:
from lightning_utilities.docs import fetch_external_assets

fetch_external_assets(
docs_folder=_PATH_HERE,
assets_folder="_static/fetched-s3-assets",
Expand All @@ -89,6 +90,8 @@ def _set_root_image_path(page_path: str) -> None:


if SPHINX_PIN_RELEASE_VERSIONS:
from lightning_utilities.docs import adjust_linked_external_docs

adjust_linked_external_docs(
"https://numpy.org/doc/stable/", "https://numpy.org/doc/{numpy.__version__}/", _PATH_ROOT
)
Expand Down

0 comments on commit c94aadb

Please sign in to comment.