File tree 5 files changed +50
-5
lines changed
5 files changed +50
-5
lines changed Original file line number Diff line number Diff line change 6
6
notify :
7
7
# This number needs to be changed whenever the number of runs in CI is changed.
8
8
# Another option is codecov-cli: https://github.com/codecov/codecov-cli#send-notifications
9
- after_n_builds : 27
9
+ after_n_builds : 31
10
10
wait_for_ci : false
11
11
notify_error : true # if uploads fail, replace cov comment with a comment with errors.
12
12
require_ci_to_pass : false
Original file line number Diff line number Diff line change @@ -234,15 +234,34 @@ jobs:
234
234
cache : pip
235
235
# setuptools is needed to get distutils on 3.12, which cythonize requires
236
236
- name : install trio and setuptools
237
- run : python -m pip install --upgrade pip . setuptools
237
+ run : python -m pip install --upgrade pip . setuptools 'coverage[toml]'
238
+
239
+ - name : add cython plugin to the coveragepy config
240
+ run : >-
241
+ sed -i 's#plugins\s=\s\[\]#plugins = ["Cython.Coverage"]#'
242
+ pyproject.toml
238
243
239
244
- name : install cython & compile pyx file
245
+ env :
246
+ CFLAGS : ${{ env.CFLAGS }} -DCYTHON_TRACE_NOGIL=1
240
247
run : |
241
248
python -m pip install "cython${{ matrix.cython }}"
242
- cythonize --inplace tests/cython/test_cython.pyx
249
+ cythonize --inplace -X linetrace=True tests/cython/test_cython.pyx
243
250
244
251
- name : import & run module
245
- run : python -c 'import tests.cython.test_cython'
252
+ run : coverage run -m tests.cython.run_test_cython
253
+
254
+ - name : get Python version for codecov flag
255
+ id : get-version
256
+ run : >-
257
+ echo "version=$(python -V | cut -d' ' -f2 | cut -d'.' -f1,2)"
258
+ >> "${GITHUB_OUTPUT}"
259
+ - if : always()
260
+ uses : codecov/codecov-action@v5
261
+ with :
262
+ name : Cython
263
+ flags : Cython,${{ steps.get-version.outputs.version }}
264
+ fail_ci_if_error : true
246
265
247
266
# https://github.com/marketplace/actions/alls-green#why
248
267
check : # This job does nothing and is only used for the branch protection
Original file line number Diff line number Diff line change @@ -268,6 +268,20 @@ directory = "misc"
268
268
name = " Miscellaneous internal changes"
269
269
showcontent = true
270
270
271
+ [tool .coverage .html ]
272
+ show_contexts = true
273
+ skip_covered = false
274
+
275
+ [tool .coverage .paths ]
276
+ _site-packages-to-src-mapping = [
277
+ " src" ,
278
+ " */src" ,
279
+ ' *\src' ,
280
+ " */lib/pypy*/site-packages" ,
281
+ " */lib/python*/site-packages" ,
282
+ ' *\Lib\site-packages' ,
283
+ ]
284
+
271
285
[tool .coverage .run ]
272
286
branch = true
273
287
source_pkgs = [" trio" ]
@@ -282,10 +296,15 @@ omit = [
282
296
# The test suite spawns subprocesses to test some stuff, so make sure
283
297
# this doesn't corrupt the coverage files
284
298
parallel = true
299
+ plugins = []
300
+ relative_files = true
301
+ source = [" ." ]
285
302
286
303
[tool .coverage .report ]
287
304
precision = 1
288
305
skip_covered = true
306
+ skip_empty = true
307
+ show_missing = true
289
308
exclude_lines = [
290
309
" pragma: no cover" ,
291
310
" abc.abstractmethod" ,
@@ -296,6 +315,9 @@ exclude_lines = [
296
315
' class .*\bProtocol\b.*\):' ,
297
316
" raise NotImplementedError" ,
298
317
]
318
+ exclude_also = [
319
+ ' ^\s*@pytest\.mark\.xfail' ,
320
+ ]
299
321
partial_branches = [
300
322
" pragma: no branch" ,
301
323
" if not TYPE_CHECKING:" ,
Original file line number Diff line number Diff line change
1
+ from .test_cython import invoke_main_entry_point
2
+
3
+ invoke_main_entry_point ()
Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ async def trio_main() -> None:
19
19
nursery.start_soon(foo)
20
20
nursery.start_soon(foo)
21
21
22
- trio.run(trio_main)
22
+ def invoke_main_entry_point ():
23
+ trio.run(trio_main)
You can’t perform that action at this time.
0 commit comments