Skip to content

Commit d7fb593

Browse files
committed
Merge branch 'maintenance/gha-cython-coverage'
PR #561
2 parents 40e3294 + 6972814 commit d7fb593

File tree

8 files changed

+118
-36
lines changed

8 files changed

+118
-36
lines changed

.codecov.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
3+
codecov:
4+
notify:
5+
after_n_builds: 23 # The number of test matrix jobs uploading coverage
6+
wait_for_ci: false
7+
8+
require_ci_to_pass: false
9+
10+
comment:
11+
require_changes: true
12+
13+
coverage:
14+
range: 99.09..100
15+
status:
16+
project:
17+
default:
18+
target: 100%
19+
lib:
20+
paths:
21+
- frozenlist/
22+
target: 97.79%
23+
tests:
24+
paths:
25+
- tests/
26+
target: 100%
27+
28+
flags:
29+
library:
30+
paths:
31+
- frozenlist/
32+
configs:
33+
paths:
34+
- requirements/
35+
- ".git*"
36+
- "*.toml"
37+
- "*.yml"
38+
changelog:
39+
paths:
40+
- CHANGES/
41+
- CHANGES.rst
42+
docs:
43+
paths:
44+
- docs/
45+
- "*.md"
46+
- "*.rst"
47+
- "*.txt"
48+
tests:
49+
paths:
50+
- tests/
51+
tools:
52+
paths:
53+
- tools/
54+
55+
...

.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
@@ -236,6 +236,32 @@ jobs:
236236
shell: bash
237237
- name: Self-install
238238
run: python -Im pip install '${{ steps.wheel-file.outputs.path }}'
239+
- name: Produce the C-files for the Coverage.py Cython plugin
240+
if: >- # Only works if the dists were built with line tracing
241+
!matrix.no-extensions
242+
&& (
243+
github.event_name != 'push'
244+
|| !contains(github.ref, 'refs/tags/')
245+
)
246+
env:
247+
PYTHONPATH: packaging/
248+
run: |
249+
set -eEuo pipefail
250+
251+
python -Im pip install expandvars
252+
python -m pep517_backend.cli translate-cython
253+
shell: bash
254+
- name: Disable the Cython.Coverage Produce plugin
255+
if: >- # Only works if the dists were built with line tracing
256+
matrix.no-extensions
257+
|| (
258+
github.event_name == 'push'
259+
&& contains(github.ref, 'refs/tags/')
260+
)
261+
run: |
262+
set -eEuo pipefail
263+
sed -i.bak 's/^plugins = .*//g' .coveragerc
264+
shell: bash
239265
- name: Run unittests
240266
env:
241267
COLOR: 'yes'

CHANGES/560.contrib.rst

+10
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ Here's a usage example:
1414
1515
For editable installs, this setting is on by default. Otherwise, it's
1616
off unless requested explicitly.
17+
18+
The following produces C-files required for the Cython coverage
19+
plugin to map the measurements back to the PYX-files:
20+
21+
.. code-block:: console
22+
23+
$ python -Im pip install -e .
24+
25+
Alternatively, the `FROZENLIST_CYTHON_TRACING=1` environment variable
26+
can be set to do the same as the :pep:`517` config setting.

CHANGES/561.contrib.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Coverage collection has been implemented for the Cython modules
2+
-- by :user:`webknjaz`.
3+
4+
It will also be reported to Codecov from any non-release CI jobs.

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

codecov.yml

-36
This file was deleted.

docs/spelling_wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ ClientSession
5050
cls
5151
cmd
5252
codec
53+
Codecov
5354
Codings
5455
committer
5556
committers

0 commit comments

Comments
 (0)