1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-11 15:31:32 +00:00

Add a Sphinx extension to generate documentation coverage information

This commit is contained in:
Adrián Chaves 2019-01-04 18:17:35 +01:00
parent 890e7fbd5b
commit c7b5ad0e20
5 changed files with 27 additions and 2 deletions

View File

@ -82,6 +82,9 @@ pydoc-topics: build
@echo "Building finished; now copy build/pydoc-topics/pydoc_topics.py " \
"into the Lib/ directory"
coverage: BUILDER = coverage
coverage: build
htmlview: html
$(PYTHON) -c "import webbrowser, os; webbrowser.open('file://' + \
os.path.realpath('build/html/index.html'))"

View File

@ -28,7 +28,8 @@ sys.path.insert(0, path.dirname(path.dirname(__file__)))
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'scrapydocs',
'sphinx.ext.autodoc'
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
]
# Add any paths that contain templates here, relative to this directory.
@ -218,3 +219,9 @@ linkcheck_ignore = [
'http://localhost:\d+', 'http://hg.scrapy.org',
'http://directory.google.com/'
]
# Options for the Coverage extension
# ----------------------------------
coverage_ignore_pyobjects = [
]

View File

@ -99,6 +99,15 @@ Well-written patches should:
the documentation changes in the same patch. See `Documentation policies`_
below.
* if you're adding a private API, please add a regular expression to the
``coverage_ignore_pyobjects`` variable of ``docs/conf.py`` to exclude the new
private API from documentation coverage checks.
To see if your private API is skipped properly, generate a documentation
coverage report as follows::
tox -e docs-coverage
.. _submitting-patches:
Submitting patches

View File

@ -1,2 +1,2 @@
Sphinx>=1.6
Sphinx>=2.1
sphinx_rtd_theme

View File

@ -105,6 +105,12 @@ deps = {[docs]deps}
commands =
sphinx-build -W -b html . {envtmpdir}/html
[testenv:docs-coverage]
changedir = {[docs]changedir}
deps = {[docs]deps}
commands =
sphinx-build -b coverage . {envtmpdir}/coverage
[testenv:docs-links]
changedir = {[docs]changedir}
deps = {[docs]deps}