Skip to content

Commit 6fdcde4

Browse files
committed
Merge remote-tracking branch 'origin/master' into doc-update
2 parents 78c082d + 3db8b46 commit 6fdcde4

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515
* Fix for the Windows bundled version
16+
* Fix docs autogen
1617

1718
## [2.1.0] - 2020-11-03
1819

doc/source/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4444
# ones.
4545
extensions = [
46-
'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode',
46+
'sphinx.ext.autodoc',
47+
'sphinx.ext.intersphinx',
48+
'sphinx.ext.ifconfig',
49+
'sphinx.ext.viewcode',
50+
'sphinx.ext.coverage',
4751
'sphinxarg.ext'
4852
]
4953

noxfile.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,25 @@ def doc(session):
192192

193193
if not session.interactive:
194194
session.run('sphinx-build', *sphinx_args)
195-
# TODO: implement doc_cover that works with sphinx-argparse
195+
session.notify('doc_cover')
196196
else:
197197
sphinx_args[-2:-2] = [
198-
'--open-browser', '--watch', '../b2', '--ignore', '*.pyc', '--ignore', '*~'
198+
'-E', '--open-browser', '--watch', '../b2', '--ignore', '*.pyc', '--ignore', '*~'
199199
]
200200
session.run('sphinx-autobuild', *sphinx_args)
201+
202+
203+
@nox.session
204+
def doc_cover(session):
205+
"""Perform coverage analysis for the documentation."""
206+
install_myself(session, extras=['doc'])
207+
session.cd('doc')
208+
sphinx_args = ['-b', 'coverage', '-T', '-W', 'source', 'build/coverage']
209+
report_file = 'build/coverage/python.txt'
210+
session.run('sphinx-build', *sphinx_args)
211+
session.run('cat', report_file, external=True)
212+
213+
with open('build/coverage/python.txt') as fd:
214+
# If there is no undocumented files, the report should have only 2 lines (header)
215+
if sum(1 for _ in fd) != 2:
216+
session.error('sphinx coverage has failed')

0 commit comments

Comments
 (0)