Skip to content

Commit 7ff2bc0

Browse files
basic doctest setup
1 parent 35f8919 commit 7ff2bc0

File tree

4 files changed

+14
-49
lines changed

4 files changed

+14
-49
lines changed

.readthedocs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ python:
1313
- requirements: requirements.txt
1414
- method: pip
1515
path: .
16+
17+
sphinx:
18+
configuration: docs/source/conf.py

docs/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = # "-W" treats warnings as errors
6-
SPHINXBUILD ?= sphinx-multiversion
7-
SOURCEDIR = .
8-
BUILDDIR ?= _build
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = source
8+
BUILDDIR = _build
99

1010
# Put it first so that "make" without argument is like "make help".
1111
help:
@@ -20,6 +20,11 @@ clean:
2020
local:
2121
sphinx-build "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2222

23+
doctest:
24+
$(SPHINXBUILD) -b doctest $(SOURCEDIR) $(BUILDDIR)/doctest
25+
@echo "Testing of doctests in the sources finished, look at the " \
26+
"results in $(BUILDDIR)/doctest/output.txt."
27+
2328
# Catch-all target: route all unknown targets to Sphinx using the new
2429
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2530
%: Makefile

docs/index.rst

-44
This file was deleted.

docs/conf.py renamed to docs/source/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
# ones.
5757
extensions = [
5858
"sphinx.ext.autodoc",
59+
"sphinx.ext.doctest",
5960
"sphinx.ext.autosummary",
6061
"sphinx.ext.viewcode",
6162
"sphinx.ext.napoleon",
@@ -127,7 +128,7 @@
127128
# Add any paths that contain custom static files (such as style sheets) here,
128129
# relative to this directory. They are copied after the builtin static files,
129130
# so a file named "default.css" will overwrite the builtin "default.css".
130-
html_static_path = ["_static"]
131+
html_static_path = ["../_static"]
131132

132133
# -- Options for HTMLHelp output ---------------------------------------------
133134

0 commit comments

Comments
 (0)