coverage-conditional-plugin
Conditional coverage based on any rules you define!
Decision gist · record as of 2026-08-14
Yes, if you maintain a multi-environment test suite (different Python versions, OSes, or optional dependencies) and want accurate coverage reporting across all of them. The low install friction and permissive license make adoption straightforward. However, the dormant maintenance status (last release June 2023, no recent commits) means you should verify compatibility with your current coverage.py and Python versions before relying on it in production CI—consider forking or monitoring the upstream repository if you need active support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires coverage to be installed and configured in your project; the plugin integrates via coverage.py's plugin system and must be declared in setup.cfg, .coveragerc, or pyproject.toml.
- Low install friction; pure Python wheel with three straightforward runtime dependencies (coverage, packaging, importlib_metadata).
- Maintenance is dormant—last release was 2023-06-02 and no commits since 2025-01-03—so expect no active bug fixes or feature updates, though the codebase appears stable.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions, provided you retain the license notice.
last release 2023-06-02 (1169 days) · last repo commit 2025-01-03 · 80 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 169,080 downloads/mo, #10,429 on PyPI
Alternatives
Verify before relying
pip install coverage-conditional-plugin
# In setup.cfg or .coveragerc:
[coverage:run]
plugins = coverage_conditional_plugin
[coverage:coverage_conditional_plugin]
rules =
"sys_version_info >= (3, 8)": py-gte-38
"is_installed('django')": has-django
# In your code:
# pragma: py-gte-38
some_code_for_python_38_plus()
# pragma: has-django
django_specific_code()- Whether the plugin works correctly with all coverage.py versions currently in use (fact sheet does not specify coverage version constraints).
- Performance impact when evaluating many conditional rules across a large codebase.
- Whether dormant maintenance status affects compatibility with recent Python or coverage.py releases.
What it is and what it does
coverage-conditional-plugin extends coverage.py to mark code as covered or uncovered based on runtime conditions rather than static pragmas. Instead of using `# pragma: no cover` for code that only runs on certain Python versions, operating systems, or when specific packages are installed, you define named rules (e.g., `"sys_version_info >= (3, 8)": py-gte-38`) in your coverage configuration, then annotate code with `# pragma: py-gte-38`. The plugin evaluates the condition at test time and includes or excludes that code from coverage accordingly.
It supports environment markers from PEP 496 (Python version, OS, platform), custom functions like `is_installed()` to check for optional dependencies, and `package_version()` to version-gate code. You can also conditionally omit entire files based on conditions. This is useful for projects with platform-specific code, version-specific features, or optional dependencies—you can achieve 100% coverage in multiple test environments without littering your code with unconditional pragmas.
Use it for
- Mark Windows-only or Linux-only code blocks so they are only counted as covered when tests run on that platform.
- Exclude code that only executes on Python 3.7 from coverage when testing on Python 3.10+, and vice versa.
- Include or exclude optional-dependency code (e.g., Django integration) based on whether the package is installed in the test environment.
- Achieve 100% coverage across multiple CI jobs that test different Python versions or OS combinations without false negatives.
- Version-gate code paths so that code for a deprecated feature version is only measured when that version is present.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you maintain a multi-environment test suite (different Python versions, OSes, or optional dependencies) and want accurate coverage reporting across all of them.
The low install friction and permissive license make adoption straightforward. However, the dormant maintenance status (last release June 2023, no recent commits) means you should verify compatibility with your current coverage.py and Python versions before relying on it in production CI—consider forking or monitoring the upstream repository if you need active support.
Install
coverage-conditional-plugin on PyPI
Before you install
Low install friction; pure Python wheel with three straightforward runtime dependencies (coverage, packaging, importlib_metadata). Maintenance is dormant—last release was 2023-06-02 and no commits since 2025-01-03—so expect no active bug fixes or feature updates, though the codebase appears stable.
Requires coverage to be installed and configured in your project; the plugin integrates via coverage.py's plugin system and must be declared in setup.cfg, .coveragerc, or pyproject.toml.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions, provided you retain the license notice.
Quickstart
pip install coverage-conditional-plugin
# In setup.cfg or .coveragerc:
[coverage:run]
plugins = coverage_conditional_plugin
[coverage:coverage_conditional_plugin]
rules =
"sys_version_info >= (3, 8)": py-gte-38
"is_installed('django')": has-django
# In your code:
# pragma: py-gte-38
some_code_for_python_38_plus()
# pragma: has-django
django_specific_code()
Verify before relying
- Whether the plugin works correctly with all coverage.py versions currently in use (fact sheet does not specify coverage version constraints).
- Performance impact when evaluating many conditional rules across a large codebase.
- Whether dormant maintenance status affects compatibility with recent Python or coverage.py releases.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7,<4.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagescoveragepackagingimportlib_metadata |
| Maintenance | Dormant 1,169 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 169,080 / month, #10,429 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: coverage_conditional_plugin-0.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “coverage.py plugin conditional”
- coverage-conditional-pluginA coverage.py plugin that applies conditional coverage rules based on…
- django-coverage-pluginA coverage.py plugin that measures test coverage of Django templates,…
- coverage-badgeGenerates SVG coverage badges from Coverage.py data files, displaying…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also conditional · covdefaults · update_checker · django-coverage-plugin · coverage_enable_subprocess · coverage · pytest-skip-markers · pytest-enabler · pytest-cover · mypy-strict-kwargs