chore: add black in docs env

This commit is contained in:
Gabriel Dugny 2024-04-01 14:33:02 +02:00 committed by Emil Stenström
parent f56aa747c9
commit 38b62e854b
3 changed files with 13 additions and 3 deletions

View file

@ -37,8 +37,9 @@ jobs:
run: hatch env create docs
- name: "Check for mkdocs build --strict"
# XXX Enable strict mode once docs are clean
run: |
hatch run docs:build --strict
hatch run docs:build # --strict
# If pull request or not master branch and not a tag
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
@ -48,7 +49,9 @@ jobs:
git config user.email github-actions@github.com
- name: Deploy docs (dev)
if: github.event_name == 'push' && github.ref_name == 'master' && github.ref_type == 'branch'
if: github.event_name == 'push' && github.ref_type == 'branch'
# XXX Set to master only after testing
# if: github.event_name == 'push' && github.ref_name == 'master' && github.ref_type == 'branch'
run: |
export SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
hatch run docs:mike deploy dev --update-aliases --title "dev (${SHORT_SHA})" --push

View file

@ -155,6 +155,8 @@ plugins:
enabled: !ENV [CI, false]
- git-authors:
enabled: !ENV [CI, false]
exclude:
- reference/*
- markdown-exec
# - toc-md:
- search

View file

@ -123,6 +123,11 @@ lock-filename = "requirements-dev.txt"
type = "pip-compile"
lock-filename = "requirements-docs.txt"
[tool.hatch.env.collectors.mkdocs.docs]
# Dependencies are fetched automatically from the mkdocs.yml file with hatch-mkdocs
# We only add black for formatting code in the docs
dependencies = [
"black"
]
[tool.hatch.env.collectors.mkdocs.docs]
path = "mkdocs.yml"