Skip to content

Commit

Permalink
♻️ Move documentation building command to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed Apr 19, 2024
1 parent ca5fed0 commit 5a03056
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Sphinx build
run: |
make html SPHINXOPTS="-W"

- name: Install hatch
run: pip install hatch

- name: Build documentation
run: hatch run docs:build

check_links:
name: Check links
Expand All @@ -39,17 +40,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Sphinx build
# Set warnings to be treated as errors
run: |
make html SPHINXOPTS="-W"

- name: Install hatch
run: pip install hatch

- name: Build documentation
run: hatch run docs:build

- name: Link Checker
uses: lycheeverse/[email protected]
with:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ dependencies = [
"pydata-sphinx-theme>=0.15.0",
"Sphinx>=7.3.0",
]
pre-install-commands = ["pip install -r docs/requirements.txt"]

[tool.hatch.envs.docs.scripts]
build = [
# Treat warnings as errors
"make -C docs html SPHINXOPTS='-W'"
]

[tool.hatch.envs.lint]
detached = true
Expand Down

0 comments on commit 5a03056

Please sign in to comment.