File tree Expand file tree Collapse file tree 5 files changed +29
-5
lines changed Expand file tree Collapse file tree 5 files changed +29
-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 @@ -296,6 +296,7 @@ omit = [
296
296
# The test suite spawns subprocesses to test some stuff, so make sure
297
297
# this doesn't corrupt the coverage files
298
298
parallel = true
299
+ plugins = []
299
300
relative_files = true
300
301
source = [" ." ]
301
302
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