Skip to content

Commit

Permalink
ci/doc: install with -e to resolve source links (#2740)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Sep 13, 2024
1 parent cb1ab37 commit fa351e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,11 @@ jobs:
pytorch-version: ${{ matrix.pytorch-version }}
pypi-dir: ${{ env.PYPI_CACHE }}

- name: Install Latex
if: ${{ matrix.target == 'html' }}
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y \
texlive-latex-extra texlive-pictures texlive-fonts-recommended dvipng cm-super
- name: Install package & dependencies
run: |
make get-sphinx-template
pip install . -U -r requirements/_docs.txt \
# install with -e so the path to source link comes from this project not from the installed package
pip install -e . -U -r requirements/_docs.txt \
--find-links="${PYPI_CACHE}" --find-links="${TORCH_URL}"
- run: pip list
- name: Full build for deployment
Expand All @@ -70,7 +63,10 @@ jobs:
run: echo "SPHINX_ENABLE_GALLERY=0" >> $GITHUB_ENV
- name: make ${{ matrix.target }}
working-directory: ./docs
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
run: |
pwd
ls -la
make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
- name: Upload built docs
if: ${{ matrix.target == 'html' && github.event_name != 'pull_request' }}
Expand Down
8 changes: 6 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ def _set_root_image_path(page_path: str) -> None:
),
]

# MathJax configuration
mathjax3_config = {
"tex": {"packages": {"[+]": ["ams", "newcommand", "configMacros"]}},
}

# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
Expand Down Expand Up @@ -358,8 +363,7 @@ def package_list_from_file(file: str) -> list[str]:
autodoc_mock_imports = MOCK_PACKAGES


# Resolve function
# This function is used to populate the (source) links in the API
# Resolve function - this function is used to populate the (source) links in the API
def linkcode_resolve(domain, info) -> Optional[str]: # noqa: ANN001
return _linkcode_resolve(domain, info=info, github_user="Lightning-AI", github_repo="torchmetrics")

Expand Down

0 comments on commit fa351e8

Please sign in to comment.