A Sphinx extension providing coverage details embedded in documentation pages.
Project description
Sphinx Reports
The Sphinx extension sphinx_reports
offers a set of directives to integrate reports and summaries into the
documentation generated by Sphinx.
Supported format reports are:
- ✅ Documentation coverage (by
docstr_coverage
(orinterrogate
?)) - 🚧 Code coverage (by
Coverage.py
) - 🚧 Unit Test summaries (by
pytest
) - 🚧 Dependencies (reading
requirements.txt
files)
Extension Configuration
This README demonstrates a quick and minimal configuration for the Sphinx extension and it's provided directives. See the sphinx-reports documentation for more details.
At first, add the extension name to the list of extensions in conf.py
, so the extension is loaded by Sphinx.
# Sphinx extensions
extensions = [
# ...
"sphinx_reports",
]
Each report directive might require an individual configuration, therefore see the next sections for details.
Documentation Coverage
DocCov: write introduction
Quick Configuration
This is a quick and minimal configuration for the documentation coverage directives. See documentation coverage documentation for more details.
-
Configure one or more Python packages for documentation coverage analysis in
conf.py
by adding a new 'section' defining some configuration variables. Each package is identified by an ID, which is later referred to by the report directive. Here, the ID is calledsrc
(dictionary key). Each package needs 4 configuration entries:name
Name of the Python package[^PkgNameVsPkgDir].directory
The directory of the package to analyze.fail_below
An integer value in range 0..100, for when a documentation coverage is considered FAILED.levels
A dictionary of coverage limits, their description and CSS style classes.
# ============================================================================== # Sphinx-reports - DocCov # ============================================================================== report_doccov_packages = { "src": { "name": "myPackage", "directory": "../myPackage", "fail_below": 80, "levels": { 30: {"class": "doccov-below30", "desc": "almost undocumented"}, 50: {"class": "doccov-below50", "desc": "poorly documented"}, 80: {"class": "doccov-below80", "desc": "roughly documented"}, 90: {"class": "doccov-below90", "desc": "well documented"}, 100: {"class": "doccov-below100", "desc": "excellent documented"}, }, } }
-
Add the
doc-coverage
into your Restructured Text (ReST) document.packageid
The ID used inconf.py
to describe a Python package.legend
(optional)
Position of the legend (NoLegend
,Top
,Bottom
,Both
)
.. report:doc-coverage:: :packageid: src
Code Coverage
CodeCov: write introduction
Unit Test Summary
UnitTest: write introduction
Dependencies
Dep: write introduction
Contributors
- Patrick Lehmann (Maintainer)
License
This Python package (source code) is licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution-4.0 (CC-BY 4.0).
SPDX-License-Identifier: Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sphinx_reports-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e6ffef153b98c659f96f8716f56d8075efdf1fcfe4424f4f5de4144bb85077 |
|
MD5 | f623c09d323592d6fe3bf1264ed14caa |
|
BLAKE2b-256 | 972d7217a6b050de5b48689958563bffd85b2a36158acbe9727f66f56340a755 |