Skip to content

Commit 91d4e09

Browse files
committed
🧪 Collect Cython coverage in CI
1 parent c986f69 commit 91d4e09

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.coveragerc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[paths]
2+
source =
3+
frozenlist
4+
*/lib/pypy*/site-packages/frozenlist
5+
*/lib/python*/site-packages/frozenlist
6+
*/Lib/site-packages/frozenlist
7+
8+
[report]
9+
skip_covered = true
10+
skip_empty = true
11+
show_missing = true
12+
13+
[run]
14+
branch = true
15+
cover_pylib = false
16+
plugins = Cython.Coverage
17+
relative_files = true
18+
source =
19+
tests
20+
source_pkgs =
21+
frozenlist

.github/workflows/ci-cd.yml

+26
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,32 @@ jobs:
276276
shell: bash
277277
- name: Self-install
278278
run: python -Im pip install '${{ steps.wheel-file.outputs.path }}'
279+
- name: Produce the C-files for the Coverage.py Cython plugin
280+
if: >- # Only works if the dists were built with line tracing
281+
!matrix.no-extensions
282+
&& (
283+
github.event_name != 'push'
284+
|| !contains(github.ref, 'refs/tags/')
285+
)
286+
env:
287+
PYTHONPATH: packaging/
288+
run: |
289+
set -eEuo pipefail
290+
291+
python -Im pip install expandvars
292+
python -m pep517_backend.cli translate-cython
293+
shell: bash
294+
- name: Disable the Cython.Coverage Produce plugin
295+
if: >- # Only works if the dists were built with line tracing
296+
matrix.no-extensions
297+
|| (
298+
github.event_name == 'push'
299+
&& contains(github.ref, 'refs/tags/')
300+
)
301+
run: |
302+
set -eEuo pipefail
303+
sed -i.bak 's/^plugins = .*//g' .coveragerc
304+
shell: bash
279305
- name: Run unittests
280306
env:
281307
COLOR: 'yes'

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include .coveragerc
12
include pyproject.toml
23
include pytest.ini
34
include pytest.ci.ini

0 commit comments

Comments
 (0)