Skip to content

Commit

Permalink
rename docs/source-app & adjust docs links for lightning (#16676)
Browse files Browse the repository at this point in the history
* update CI

* config / import

* lightning_app imports

* source/ dir

* html

* ci: dirs

* pr

* req dir

* on push

* rename

* drop

* cleaning
  • Loading branch information
Borda authored Feb 13, 2023
1 parent d660379 commit 0be025e
Show file tree
Hide file tree
Showing 342 changed files with 391 additions and 409 deletions.
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
/docs/source-pytorch/index.rst @williamfalcon @lantiga
/docs/source-pytorch/levels @williamfalcon @RobertLaurella
/docs/source-pytorch/expertise_levels @williamfalcon @RobertLaurella
/docs/source-app/ @williamfalcon @RobertLaurella @tchaton @awaelchli
/docs/source-app/conf.py @borda @awaelchli @carmocca
/docs/source-app/index.rst @williamfalcon @lantiga
/docs/source-app/expertise_levels @williamfalcon @RobertLaurella
/docs/source/ @williamfalcon @RobertLaurella @tchaton @awaelchli
/docs/source/conf.py @borda @awaelchli @carmocca
/docs/source/index.rst @williamfalcon @lantiga
/docs/source/expertise_levels @williamfalcon @RobertLaurella

# PyTorch Lightning
/src/lightning/pytorch @williamfalcon @awaelchli @carmocca @justusschock
Expand All @@ -40,9 +40,9 @@
/src/lightning/pytorch/core/module.py @williamfalcon @tchaton @awaelchli @carmocca

# Lightning Fabric
/src/lightning/fabric @awaelchli @carmocca @justusschock
/src/lightning_fabric @awaelchli @carmocca @justusschock
/tests/tests_fabric @awaelchli @carmocca @justusschock
/src/lightning/fabric @awaelchli @carmocca @justusschock
/src/lightning_fabric @awaelchli @carmocca @justusschock
/tests/tests_fabric @awaelchli @carmocca @justusschock

# Lightning App
/src/lightning/app @tchaton @lantiga @awaelchli @hhsecond @ethanwharris
Expand Down
2 changes: 1 addition & 1 deletion .github/checkgroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ subprojects:
- ".actions/**"
- "src/lightning/app/**"
- "src/lightning_app/*"
- "docs/source-app/**"
- "docs/source/**"
- ".github/workflows/docs-checks.yml"
- "requirements/docs.txt"
- "requirements/app/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ app:
- 'tests/integrations_app/**'
- 'tests/integrations_app_examples/**'
- 'examples/app_*/**'
- 'docs/source-app/**'
- 'docs/source/**'
- 'requirements/app/**'

pl:
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ defaults:
run:
shell: bash

env:
FREEZE_REQUIREMENTS: "1"
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"

jobs:
make-doctest:
runs-on: ubuntu-latest
Expand All @@ -35,24 +39,22 @@ jobs:
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "pytorch"]
env:
FREEZE_REQUIREMENTS: "1"
pkg-name: ["lightning", "pytorch"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}

- uses: aws-actions/configure-aws-credentials@v1
if: ${{ matrix.pkg-name == 'app' }}
if: ${{ matrix.pkg-name == 'lightning' }}
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-region: us-east-1

- run: aws s3 sync s3://sphinx-packages/ pypi/
if: ${{ matrix.pkg-name == 'app' }}
if: ${{ matrix.pkg-name == 'lightning' }}

# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
Expand All @@ -65,29 +67,34 @@ jobs:

- name: Install LAI package
# This is needed as App docs is heavily using/referring to lightning package
if: ${{ matrix.pkg-name == 'app' }}
if: ${{ matrix.pkg-name == 'lightning' }}
run: |
pip install -e . -U -v -f https://download.pytorch.org/whl/cpu/torch_stable.html -f pypi
pip install -e . -U -v -f pypi -f ${TORCH_URL}
- name: Adjust docs refs
if: ${{ matrix.pkg-name == 'app' }}
if: ${{ matrix.pkg-name == 'lightning' }}
run: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports --source_dir="./docs" \
--source_import="pytorch_lightning,lightning_fabric" \
--target_import="lightning.pytorch,lightning.fabric"
- name: adjust paths
run: |
python -c "n = '${{ matrix.pkg-name }}' ; print('DOCS_DIR=source' + {'lightning': '', 'pytorch': '-pytorch'}.get(n))" >> $GITHUB_ENV
python -c "n = '${{ matrix.pkg-name }}' ; print('REQ_DIR=' + {'lightning': 'app'}.get(n, n))" >> $GITHUB_ENV
- name: Install this package
env:
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg-name }}/docs.txt -f pypi
pip install -e .[extra,cloud,ui] -U -r requirements/${{ env.REQ_DIR }}/docs.txt -f pypi -f ${TORCH_URL}
pip list
- name: Test Documentation
env:
SPHINX_MOCK_REQUIREMENTS: 0
working-directory: ./docs/source-${{ matrix.pkg-name }}
working-directory: ./docs/${{ env.DOCS_DIR }}
run: |
make doctest
make coverage
Expand All @@ -99,9 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "pytorch"]
env:
FREEZE_REQUIREMENTS: "1"
pkg-name: ["lightning", "pytorch"]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -124,26 +129,30 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: docs-make-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: docs-make-${{ matrix.pkg-name }}-
key: docs-make-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: docs-make-

- name: adjust paths
run: |
python -c "n = '${{ matrix.pkg-name }}' ; print('DOCS_DIR=source' + {'lightning': '', 'pytorch': '-pytorch'}.get(n))" >> $GITHUB_ENV
python -c "n = '${{ matrix.pkg-name }}' ; print('REQ_DIR=' + {'lightning': 'app'}.get(n, n))" >> $GITHUB_ENV
- name: Install package & dependencies
env:
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
pip --version
pip install -e . -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
-f https://download.pytorch.org/whl/cpu/torch_stable.html -f pypi
pip install -e . -U -r requirements/${{ env.REQ_DIR }}/docs.txt -f pypi -f ${TORCH_URL}
pip list
shell: bash

- name: Make Documentation
working-directory: ./docs/source-${{ matrix.pkg-name }}
working-directory: ./docs/${{ env.DOCS_DIR }}
run: |
make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
- name: Check External Links in Sphinx Documentation (Optional)
working-directory: ./docs/source-${{ matrix.pkg-name }}
working-directory: ./docs/${{ env.DOCS_DIR }}
run: |
make linkcheck
continue-on-error: true
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: deploy-docs-pip-${{ hashFiles('requirements/app/*.txt') }}
key: deploy-docs-pip-${{ hashFiles('requirements/**/*.txt') }}
restore-keys: deploy-docs-pip-

- name: Install package & dependencies
env:
FREEZE_REQUIREMENTS: 1
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
run: |
pip --version
pip install -e . --quiet -r requirements/app/docs.txt \
-f https://download.pytorch.org/whl/cpu/torch_stable.html -f pypi
pip install -e . -r requirements/app/docs.txt \
-f ${TORCH_URL} -f pypi
pip list
- name: Make Documentation
working-directory: ./docs/source-app
working-directory: ./docs/source
run: |
# First run the same pipeline as Read-The-Docs
make clean
Expand All @@ -69,12 +70,14 @@ jobs:
single-commit: true # you'd prefer to have a single commit on the deployment branch instead of full history
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

- name: 'Authenticate to Google Cloud'
- name: Authenticate to Google Cloud
if: github.event_name == 'push'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCS_SA_KEY }}

- name: Setup gcloud
if: github.event_name == 'push'
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCS_PROJECT }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ lightning_logs/
.vscode/

# Documentations
docs/source-app/generated
docs/source-app/*/generated
docs/source/generated
docs/source/*/generated
docs/source-pytorch/api
docs/source-pytorch/*.md
docs/source-pytorch/generated
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ repos:
hooks:
- id: isort
name: Format imports
exclude: docs/source-app
exclude: docs/source

- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
name: Format code
exclude: docs/source-app
exclude: docs/source

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
args: [--line-length=120]
exclude: docs/source-app
exclude: docs/source

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ clean:
rm -rf ./docs/source-pytorch/generated
rm -rf ./docs/source-pytorch/*/generated
rm -rf ./docs/source-pytorch/api
rm -rf ./docs/source-app/generated
rm -rf ./docs/source-app/*/generated
rm -rf ./docs/source/generated
rm -rf ./docs/source/*/generated
rm -rf build
rm -rf dist
rm -rf *.egg-info
Expand All @@ -45,7 +45,7 @@ test: clean

docs: clean
pip install -e . --quiet -r requirements/app/docs.txt
cd docs/source-app && $(MAKE) html
cd docs/source && $(MAKE) html

update:
git submodule update --init --recursive --remote

This file was deleted.

This file was deleted.

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lightning.app.components
:local:
:backlinks: top

.. currentmodule:: lightning_app.components
.. currentmodule:: lightning.app.components


Built-in Components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lightning.app.core
:local:
:backlinks: top

.. currentmodule:: lightning_app.core
.. currentmodule:: lightning.app.core

Core APIs
___________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lightning.app.frontend
:local:
:backlinks: top

.. currentmodule:: lightning_app.frontend
.. currentmodule:: lightning.app.frontend

Lightning FrontEnds
___________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lightning.app.runners
:local:
:backlinks: top

.. currentmodule:: lightning_app.runners
.. currentmodule:: lightning.app.runners

Lightning Core
______________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ______________
:local:
:backlinks: top

.. currentmodule:: lightning_app.storage
.. currentmodule:: lightning.app.storage

.. autosummary::
:toctree: generated/
Expand Down
Loading

0 comments on commit 0be025e

Please sign in to comment.