Skip to main content

A Sphinx extension providing coverage details embedded in documentation pages.

Project description

Sourcecode on GitHub License GitHub tag (latest SemVer incl. pre-release) GitHub release (latest SemVer incl. including pre-releases) GitHub release date
GitHub Workflow Status PyPI PyPI - Status PyPI - Python Version Dependent repos (via libraries.io)
Libraries.io status for latest release Requires.io
Codacy - Quality Codacy - Coverage Codecov - Branch Coverage Libraries.io SourceRank

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 (or interrogate?))
  • 🚧 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.

  1. 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 called src (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"},
        },
      }
    }
    
  2. Add the doc-coverage into your Restructured Text (ReST) document.

    • packageid
      The ID used in conf.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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_reports-0.1.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_reports-0.1.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_reports-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_reports-0.1.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for sphinx_reports-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9bd37b630e51559fd8d131b1f5dbd9ad855b05023954e20acde78ac75e6a6b21
MD5 49459f504e6666e414994a5b718c7017
BLAKE2b-256 3599d832a02b9c542e139c56448bcf470b1491f0fd1f9acf0544ab765f992721

See more details on using hashes here.

File details

Details for the file sphinx_reports-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_reports-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for sphinx_reports-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e6ffef153b98c659f96f8716f56d8075efdf1fcfe4424f4f5de4144bb85077
MD5 f623c09d323592d6fe3bf1264ed14caa
BLAKE2b-256 972d7217a6b050de5b48689958563bffd85b2a36158acbe9727f66f56340a755

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page