Skip to content

Commit fc2fc48

Browse files
authored
Refactor documenation nox tasks (#273)
1 parent 809d776 commit fc2fc48

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Build Documentation
4040
run: |
41-
poetry run python -m nox -s build-docs
41+
poetry run python -m nox -s docs:build
4242
4343
Lint:
4444
name: Linting (Python-${{ matrix.python-version }})

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Build Documentation
2020
run: |
21-
poetry run sphinx-multiversion doc/ .html-documentation
21+
poetry run python -m nox -s docs:multiversion
2222
2323
- name: Deploy
2424
uses: JamesIves/github-pages-deploy-action@v4.6.3

doc/changes/unreleased.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
## 🚨 Breaking Changes
44

55
* Dropped python 3.8 support
6+
* Changed names of Documentation related nox tasks
7+
- `build-docs` -> `docs:build`
8+
- `open-docs` -> `docs:open`
9+
- `clean-docs` -> `docs:clean`
610

711
## ✨ Added
812

913
* Added support for multi version Documentation
14+
* Added nox tasks for building multi-version documentation
1015

1116
## 🐞 Fixed
1217

doc/user_guide/getting_started.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Build and open the documentation:
7171

7272
.. code-block:: shell
7373
74-
nox -s build-docs open-docs
74+
nox -s docs:build docs:open
7575
7676
Execute the unit tests of the project:
7777

@@ -191,9 +191,9 @@ You are ready to use the toolbox. With *nox -l* you can list all available tasks
191191
- unit-tests -> Runs all unit tests
192192
- integration-tests -> Runs the all integration tests
193193
- coverage -> Runs all tests (unit + integration) and reports the code coverage
194-
- build-docs -> Builds the project documentation
195-
- open-docs -> Opens the built project documentation
196-
- clean-docs -> Removes the documentations build folder
194+
- docs:build -> Builds the project documentation
195+
- docs:open -> Opens the built project documentation
196+
- docs:clean -> Removes the documentations build folder
197197
- report -> Collects and generates a metrics summary for the workspace
198198
199199
sessions marked with * are selected, sessions marked with - are skipped.

exasol/toolbox/nox/_documentation.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,29 @@ def _build_docs(session: nox.Session, config: Config) -> None:
2626
)
2727

2828

29-
@nox.session(name="build-docs", python=False)
29+
def _build_multiversion_docs(session: nox.Session, config: Config) -> None:
30+
session.run(
31+
"poetry",
32+
"run",
33+
"sphinx-multiversion",
34+
f"{config.doc}",
35+
DOCS_OUTPUT_DIR,
36+
)
37+
38+
39+
@nox.session(name="docs:multiversion", python=False)
40+
def build_multiversion(session: Session) -> None:
41+
"""Builds the project documentation"""
42+
_build_multiversion_docs(session, PROJECT_CONFIG)
43+
44+
45+
@nox.session(name="docs:build", python=False)
3046
def build_docs(session: Session) -> None:
3147
"""Builds the project documentation"""
3248
_build_docs(session, PROJECT_CONFIG)
3349

3450

35-
@nox.session(name="open-docs", python=False)
51+
@nox.session(name="docs:open", python=False)
3652
def open_docs(session: Session) -> None:
3753
"""Opens the built project documentation"""
3854
docs_folder = PROJECT_CONFIG.root / DOCS_OUTPUT_DIR
@@ -42,7 +58,7 @@ def open_docs(session: Session) -> None:
4258
webbrowser.open_new_tab(index.as_uri())
4359

4460

45-
@nox.session(name="clean-docs", python=False)
61+
@nox.session(name="docs:clean", python=False)
4662
def clean_docs(_session: Session) -> None:
4763
"""Removes the documentations build folder"""
4864
docs_folder = PROJECT_CONFIG.root / DOCS_OUTPUT_DIR

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Build Documentation
4646
run: |
47-
poetry run python -m nox -s build-docs
47+
poetry run python -m nox -s docs:build
4848
4949
Lint:
5050
name: Linting (Python-${{ matrix.python-version }})

0 commit comments

Comments
 (0)