Skip to content

Commit 2b7a456

Browse files
committed
Add CI job to check docs including doctest
Fixes #1027, #1028
1 parent dafae31 commit 2b7a456

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

.circleci/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
- image: circleci/python:3.6
5353
environment:
5454
TOXENV: lint-py36
55+
py36-docs:
56+
<<: *common
57+
docker:
58+
- image: circleci/python:3.6
59+
environment:
60+
TOXENV: py36-docs
5561
py35-native-state-byzantium:
5662
<<: *common
5763
docker:
@@ -243,6 +249,7 @@ workflows:
243249
version: 2
244250
test:
245251
jobs:
252+
- py36-docs
246253
- py36-native-state-byzantium
247254
- py36-native-state-frontier
248255
- py36-native-state-homestead

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ coverage:
4040
build-docs:
4141
cd docs/; sphinx-build -T -E . _build/html
4242

43+
doctest:
44+
cd docs/; sphinx-build -T -b doctest . _build/doctest
45+
46+
validate-docs: build-docs doctest
47+
4348
docs: build-docs
4449
open docs/_build/html/index.html
4550

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
extensions = [
4242
'sphinx.ext.todo',
4343
'sphinx.ext.autodoc',
44+
'sphinx.ext.doctest',
4445
'sphinx.ext.intersphinx',
4546
'sphinxcontrib.asyncio',
4647
]
@@ -180,3 +181,14 @@
180181
'python': ('https://docs.python.org/3.5', None),
181182
'eth-typing': ('https://eth-typing.readthedocs.io/en/latest', None),
182183
}
184+
185+
# -- Doctest configuration ----------------------------------------
186+
187+
import doctest
188+
189+
doctest_default_flags = (0
190+
| doctest.DONT_ACCEPT_TRUE_FOR_1
191+
| doctest.ELLIPSIS
192+
| doctest.IGNORE_EXCEPTION_DETAIL
193+
| doctest.NORMALIZE_WHITESPACE
194+
)

tox.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ basepython =
4747
py36: python3.6
4848

4949

50+
[testenv:py36-docs]
51+
whitelist_externals=
52+
make
53+
deps = .[doc]
54+
basepython=python3.6
55+
passenv =
56+
PYTEST_ADDOPTS
57+
TRAVIS_EVENT_TYPE
58+
commands=
59+
make validate-docs
60+
61+
5062
[testenv:py36-trinity-integration]
5163
deps = .[eth-extras, test]
5264
basepython=python3.6

0 commit comments

Comments
 (0)