Skip to content

Commit

Permalink
Add numpydoc Sphinx extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 27, 2024
1 parent dec5667 commit 016e895
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@ jobs:
steps:
- uses: actions/checkout@v4


- name: Set up Python 3.11
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.10

- name: Install poetry
run: pipx install poetry

- name: Install python dependencies
run: |
poetry env use 3.11
poetry env use 3.10
poetry install --with docs
- name: Build docs
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10

- name: Install poetry
run: |
apt update
Expand All @@ -37,6 +42,7 @@ jobs:
- name: sphinx
run: |
export PATH="$HOME/.local/bin:$PATH"
poetry env use 3.10
poetry install --with docs
cd docs
poetry run make html
Expand Down
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"numpydoc",
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinxcontrib.contentui",
]
Expand All @@ -39,6 +40,8 @@
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
}

numpydoc_validation_checks = {"all", "EX01", "SA01", "ES01"}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ optional = true
[tool.poetry.group.docs.dependencies]
furo = "^2024.1.29"
markupsafe = "<2.1"
numpydoc = "^1.6.0"
sphinx = "^7.2.6"
sphinxcontrib-contentui = "^0.2.5"
sphinxcontrib-details-directive = "^0.1"
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
envlist = py311
envlist = py310

[testenv]
usedevelop=True

[testenv:py{39,310,312}]
[testenv:py{39,311,312}]
description = Run the test suite against Python versions
allowlist_externals = poetry
commands_pre = poetry install --no-root --sync
Expand Down

0 comments on commit 016e895

Please sign in to comment.