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 directive 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.2.0.tar.gz (21.0 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.2.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

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

Hashes for sphinx_reports-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2b54af27331b3e2a87ea9e297fc4b0f20d8026ec9e0350f146f4883ea670265e
MD5 9d1ee7a29ad193aec493bf67455db01c
BLAKE2b-256 1376a84b70d53d4ebc7864dcb988b36192b7801bcb63557bd061ca0b96ad4130

See more details on using hashes here.

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

Hashes for sphinx_reports-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e6e1698f9d51763a6944ad138b19609cfa2f92560c27e149885ec23e3be1224
MD5 ccee198102c5b6b0065052918738c30f
BLAKE2b-256 562c4702f092e0827cafedaf444f23385976a39573e94bc4aac35962de7c364d

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