Skip to content

Commit

Permalink
Merge pull request #422 from Electrostatics/nathan/371
Browse files Browse the repository at this point in the history
Update documentation testing and dependencies.
  • Loading branch information
sobolevnrm authored Dec 30, 2024
2 parents c714997 + d54f473 commit 9dd79cb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies = [
"numpy",
"propka >= 3.5",
"requests",
"docutils < 0.18",
"docutils",
]

[project.optional-dependencies]
Expand All @@ -68,6 +68,8 @@ test = [
"pandas >= 1.0",
"pytest",
"testfixtures",
"sphinx",
"sphinx-rtd-theme",
]

[project.urls]
Expand Down
42 changes: 42 additions & 0 deletions tests/sphinx_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Test Sphinx compilation of documentation."""

from pathlib import Path

from sphinx.application import Sphinx

SOURCE_DIR = Path("docs/source")
CONFIG_DIR = SOURCE_DIR


def test_html_documentation(tmp_path):
"""Test Sphinx build of HTML documentation."""
source_dir = SOURCE_DIR
config_dir = CONFIG_DIR
output_dir = tmp_path
doctree_dir = tmp_path / "doctrees"
app = Sphinx(
source_dir,
config_dir,
output_dir,
doctree_dir,
buildername="html",
warningiserror=True,
)
app.build(force_all=True)


def test_text_documentation(tmp_path):
"""Test Sphinx build of text documentation."""
source_dir = SOURCE_DIR
config_dir = CONFIG_DIR
output_dir = tmp_path
doctree_dir = tmp_path / "doctrees"
app = Sphinx(
source_dir,
config_dir,
output_dir,
doctree_dir,
buildername="text",
warningiserror=True,
)
app.build(force_all=True)

0 comments on commit 9dd79cb

Please sign in to comment.