Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation testing and dependencies. #422

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading