Skip to content

Commit

Permalink
Setup readthedocs and CI job for checking documentation building (#93)
Browse files Browse the repository at this point in the history
* circleci
    * add build-docs step for check doc building process
    * use python 3.11 for consistency
* readthedocs
    * add readthedocs config


close #94
  • Loading branch information
Lee-W authored Nov 14, 2023
1 parent 5082f17 commit a3c3d00
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 3 deletions.
20 changes: 19 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
parameters:
python_version:
type: string
default: "3.10"
default: "3.11"
docker:
- image: cimg/python:<<parameters.python_version>>

Expand Down Expand Up @@ -53,6 +53,22 @@ jobs:
name: Run pre-commit hooks
command: pre-commit run --all-files

build-docs:
description: "Build docs check (the actual publishing is handled by .readthedocs.yaml)"
executor:
name: docker-executor
steps:
- checkout
- run:
name: Install poetry
command: python -m pip install poetry
- run:
name: Install build docs dependency
command: python -m poetry install --only=docs,dev
- run:
name: Run Sphinx
command: poetry run inv docs.build

workflows:
tests:
jobs:
Expand All @@ -64,3 +80,5 @@ workflows:
<<: *all_branches_and_version_tag
- precommit:
<<: *all_branches_and_version_tag
- build-docs:
<<: *all_branches_and_version_tag
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.11"
jobs:
post_create_environment:
- python -m pip install poetry
- python -m poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --only=docs,dev

sphinx:
configuration: docs/conf.py
116 changes: 115 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ python = "^3.11"
[tool.poetry.group.dev.dependencies]
invoke = "^2.2.0"


[tool.poetry.group.docs.dependencies]
sphinx-book-theme = "^1.0.1"
rich = "^13.6.0"
myst-parser = "^2.0.0"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit a3c3d00

Please sign in to comment.