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.txtfiles)
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.pyby 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-coveragedirective into your Restructured Text (ReST) document.packageid
The ID used inconf.pyto 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_reports-0.2.0.tar.gz.
File metadata
- Download URL: sphinx_reports-0.2.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b54af27331b3e2a87ea9e297fc4b0f20d8026ec9e0350f146f4883ea670265e
|
|
| MD5 |
9d1ee7a29ad193aec493bf67455db01c
|
|
| BLAKE2b-256 |
1376a84b70d53d4ebc7864dcb988b36192b7801bcb63557bd061ca0b96ad4130
|
File details
Details for the file sphinx_reports-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_reports-0.2.0-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e6e1698f9d51763a6944ad138b19609cfa2f92560c27e149885ec23e3be1224
|
|
| MD5 |
ccee198102c5b6b0065052918738c30f
|
|
| BLAKE2b-256 |
562c4702f092e0827cafedaf444f23385976a39573e94bc4aac35962de7c364d
|