API Reference
Pyrig plugin that integrates Codecov coverage reporting into a project.
rig
Codecov overrides of pyrig's scaffolding and maintenance layer.
Mirrors pyrig's own rig namespace so its plugin-discovery mechanism picks up
this package's configuration and tooling customizations automatically.
configs
Declarative definitions of the configuration files managed by this plugin.
This package is this plugin's discovery scope for pyrig's config-file management: every file this plugin manages or overrides is defined here.
version_control
Codecov customizations for generated version-control configuration.
remote
Codecov customizations for generated GitHub remote-repository configuration.
workflows
Codecov-specific overrides for GitHub Actions workflow configuration.
health_check
Codecov integration for the health check CI workflow.
HealthCheckWorkflowConfigFile
Bases: HealthCheckWorkflowConfigFile
Health check workflow extended with a Codecov coverage upload step.
Source code in src/pyrig_codecov/rig/configs/version_control/remote/workflows/health_check.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
codecov_token_var()
Return the raw secrets expression for CODECOV_TOKEN.
Returns:
| Type | Description |
|---|---|
str
|
The |
Source code in src/pyrig_codecov/rig/configs/version_control/remote/workflows/health_check.py
66 67 68 69 70 71 72 | |
insert_codecov_token()
Return the ${{ secrets.CODECOV_TOKEN }} expression.
Returns:
| Type | Description |
|---|---|
str
|
GitHub Actions expression for the |
Source code in src/pyrig_codecov/rig/configs/version_control/remote/workflows/health_check.py
58 59 60 61 62 63 64 | |
step_upload_coverage_report(*, step=None)
Build a step that uploads the coverage report to Codecov.
Fails the CI job if the upload fails.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
dict[str, Any] | None
|
Additional keys to merge into the step configuration. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Step using |
Note
Requires a Codecov account linked to the repository (log in at codecov.io with GitHub).
Source code in src/pyrig_codecov/rig/configs/version_control/remote/workflows/health_check.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
steps_matrix_health_checks()
Return the matrix job steps, extended with a Codecov upload step.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
The base class steps plus a final step that uploads the |
list[dict[str, Any]]
|
coverage report to Codecov. |
Source code in src/pyrig_codecov/rig/configs/version_control/remote/workflows/health_check.py
15 16 17 18 19 20 21 22 23 24 25 | |
tools
Tool definitions and overrides contributed by this plugin.
Every Tool subclass that this package defines or overrides is discovered
from here, extending pyrig's tool management to cover this plugin's own
tooling.
testers
Codecov-specific overrides of pyrig's test-and-coverage tool wrappers.
coverage
Codecov-specific coverage reporting and badge configuration.
CoverageTester
Bases: CoverageTester
Coverage tool configured for Codecov as the reporting backend.
Points the coverage badge at Codecov instead of a static shields.io badge, and raises the required coverage threshold to 100%.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
access_token_key()
Return 'CODECOV_TOKEN', the env var name for the Codecov upload token.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
65 66 67 | |
additional_test_args()
Return the pytest-cov CLI flags, extended with a report-format flag.
Returns:
| Type | Description |
|---|---|
Args
|
The base pytest-cov flags plus a |
Args
|
|
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
34 35 36 37 38 39 40 41 42 43 44 | |
image_url()
Return the URL of the Codecov coverage badge image for the default branch.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
18 19 20 21 22 23 24 | |
link_url()
Return the URL of the Codecov project dashboard.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
26 27 28 | |
remote_coverage_url()
Construct the Codecov project dashboard URL for the current repository.
Resolves the repository owner from the git remote and the repository name from the project name.
Returns:
| Type | Description |
|---|---|
str
|
URL in the format |
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
report_file()
Return Path("coverage.xml"), the coverage report file path.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
69 70 71 | |
threshold()
Return 100.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
46 47 48 | |
version_control_ignore_paths()
Return the base ignore paths plus the coverage report file.
Source code in src/pyrig_codecov/rig/tools/testers/coverage.py
30 31 32 | |