Skip to content

Commit

Permalink
🧪 Collect Cython coverage in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Dec 9, 2023
1 parent c986f69 commit 91d4e09
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[paths]
source =
frozenlist
*/lib/pypy*/site-packages/frozenlist
*/lib/python*/site-packages/frozenlist
*/Lib/site-packages/frozenlist

[report]
skip_covered = true
skip_empty = true
show_missing = true

[run]
branch = true
cover_pylib = false
plugins = Cython.Coverage
relative_files = true
source =
tests
source_pkgs =
frozenlist
26 changes: 26 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,32 @@ jobs:
shell: bash
- name: Self-install
run: python -Im pip install '${{ steps.wheel-file.outputs.path }}'
- name: Produce the C-files for the Coverage.py Cython plugin
if: >- # Only works if the dists were built with line tracing
!matrix.no-extensions
&& (
github.event_name != 'push'
|| !contains(github.ref, 'refs/tags/')
)
env:
PYTHONPATH: packaging/
run: |
set -eEuo pipefail
python -Im pip install expandvars
python -m pep517_backend.cli translate-cython
shell: bash
- name: Disable the Cython.Coverage Produce plugin
if: >- # Only works if the dists were built with line tracing
matrix.no-extensions
|| (
github.event_name == 'push'
&& contains(github.ref, 'refs/tags/')
)
run: |
set -eEuo pipefail
sed -i.bak 's/^plugins = .*//g' .coveragerc
shell: bash
- name: Run unittests
env:
COLOR: 'yes'
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include .coveragerc
include pyproject.toml
include pytest.ini
include pytest.ci.ini
Expand Down

0 comments on commit 91d4e09

Please sign in to comment.