coverage-badge is a Python utility that generates SVG coverage badges based on data produced by the `Coverage.py` tool. While it currently stands at version 1.1.2, the project is in maintenance mode, meaning it will receive only occasional updates and fixes, but no new features. Users seeking more advanced features or active development are encouraged to explore alternatives like `genbadge`.
pip install coverage-badgeNo compatibility data collected yet for this library.
To generate a coverage badge, first run `Coverage.py` (e.g., via `pytest --cov`) to produce coverage data. Then, execute `coverage-badge` in the same directory as the `.coverage` data file to generate the SVG image.
Consider migrating to `genbadge` for new projects or if advanced features are required.
Navigate to the correct directory using `cd` before running `coverage-badge`, or specify the path to the `.coverage` file if the tool supported it (which it doesn't currently, based on documentation).
Always run `coverage run ...` (e.g., `coverage run -m pytest`) before attempting to generate the badge with `coverage-badge`.
Ensure `coverage-badge` is installed in your active Python environment: `pip install coverage-badge`. If using a virtual environment, make sure it's activated.
First, run `Coverage.py` to generate the coverage data (e.g., `coverage run -m pytest`). Then, execute `coverage-badge` from the same directory where the `.coverage` file was created.
Verify that `Coverage.py` runs successfully and generates valid data. Ensure `coverage-badge` is executed correctly to produce the SVG. In your CI/CD configuration (e.g., GitLab CI, GitHub Actions), confirm the badge's URL points to the correct SVG, the pipeline successfully generates the coverage artifact, and any regex patterns for parsing coverage are correct.
Install the package using pip: `pip install coverage-badge`. If you are in a virtual environment, ensure it is activated before installation.