API Reference
The top-level package for the project.
rig
Package initialization.
configs
Package initialization.
remote_version_control
Package initialization.
workflows
Package initialization.
health_check
GitHub Actions workflow generator for the health check CI stage.
HealthCheckWorkflowConfigFile
Bases: HealthCheckWorkflowConfigFile
Overrides the base class methods to customize the health check workflow.
Source code in src/pyrig_codecov/rig/configs/remote_version_control/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 73 | |
codecov_token_var()
Get the raw secrets expression for CODECOV_TOKEN.
Returns:
| Type | Description |
|---|---|
str
|
|
Source code in src/pyrig_codecov/rig/configs/remote_version_control/workflows/health_check.py
67 68 69 70 71 72 73 | |
insert_codecov_token()
Get the ${{ secrets.CODECOV_TOKEN }} expression.
Returns:
| Type | Description |
|---|---|
str
|
GitHub Actions expression for the |
Source code in src/pyrig_codecov/rig/configs/remote_version_control/workflows/health_check.py
59 60 61 62 63 64 65 | |
step_upload_coverage_report(*, step=None)
Build a step that uploads the coverage report to Codecov.
Requires a Codecov account linked to the repository (log in at codecov.io with GitHub). Fails the CI job if the upload fails, ensuring that coverage reports are always uploaded when the health check workflow runs.
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 |
Source code in src/pyrig_codecov/rig/configs/remote_version_control/workflows/health_check.py
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 | |
steps_matrix_health_checks()
Return the steps for the matrix health checks job.
Extends the base class steps with an additional step to upload the coverage report to Codecov.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of step configuration dicts for the matrix health checks job, |
list[dict[str, Any]]
|
including the Codecov upload step. |
Source code in src/pyrig_codecov/rig/configs/remote_version_control/workflows/health_check.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
tools
Package initialization.
coverage_tester
Coverage testing wrapper for the code coverage tool.
Wraps CoverageTester commands and information.
CoverageTester
Bases: CoverageTester
Overrides the base CoverageTester from pyrig.
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
access_token_key()
Get the environment variable name for the Codecov upload token.
This key is referenced in CI workflow definitions to inject the Codecov authentication token when uploading coverage reports.
Returns:
| Type | Description |
|---|---|
str
|
'CODECOV_TOKEN' |
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
73 74 75 76 77 78 79 80 81 82 | |
additional_test_args()
Get additional pytest-cov arguments for CI test runs.
Added on top of additional_test_args() during CI execution to produce an
XML coverage report, which is required for uploading results to Codecov.
Returns:
| Type | Description |
|---|---|
Args
|
Tuple containing |
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
badge_urls()
Get the Codecov badge image URL and dashboard URL.
The badge image URL points to an SVG coverage badge on Codecov's CDN scoped to the default branch. The dashboard URL is the Codecov project page for the current repository.
Returns:
| Type | Description |
|---|---|
str
|
Tuple of (badge_image_url, dashboard_url), where badge_image_url |
str
|
is the SVG badge URL including the default branch, and dashboard_url |
tuple[str, str]
|
is the Codecov project dashboard URL. |
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
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/coverage_tester.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
report_file()
Get the Path object for the coverage report file.
Returns:
| Type | Description |
|---|---|
Path
|
Path object pointing to the coverage report file |
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
84 85 86 87 88 89 90 | |
threshold()
Enforcing 100% coverage for packages with this plugin.
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
54 55 56 | |
version_control_ignore_paths()
Get the paths to ignore for version control.
Source code in src/pyrig_codecov/rig/tools/coverage_tester.py
34 35 36 | |