|
1 | 1 | #!/bin/bash
|
2 | 2 | #
|
3 |
| -# Note: cython's Cython/Coverage.py fails for pyx files that are included in |
4 |
| -# other pyx files. This gives the following error: |
| 3 | +# This needs a patched Cython: |
5 | 4 | #
|
6 |
| -# $ coverage report -m |
7 |
| -# Plugin 'Cython.Coverage.Plugin' did not provide a file reporter for |
8 |
| -# '.../python-flint/src/flint/fmpz.pyx'. |
| 5 | +# pip install git+https://github.com/oscarbenjamin/cython.git@pr_relative_paths |
9 | 6 | #
|
10 |
| -# A patch to the file is needed: |
| 7 | +# That patch has been submitted as a pull request: |
11 | 8 | #
|
12 |
| -# --- Coverage.py.backup 2022-12-09 17:36:35.387690467 +0000 |
13 |
| -# +++ Coverage.py 2022-12-09 17:08:06.282516837 +0000 |
14 |
| -# @@ -172,7 +172,9 @@ class Plugin(CoveragePlugin): |
15 |
| -# else: |
16 |
| -# c_file, _ = self._find_source_files(filename) |
17 |
| -# if not c_file: |
18 |
| -# - return None |
19 |
| -# + c_file = os.path.join(os.path.dirname(filename), 'pyflint.c') |
20 |
| -# + if not os.path.exists(c_file): |
21 |
| -# + return None |
22 |
| -# rel_file_path, code = self._read_source_lines(c_file, filename) |
23 |
| -# if code is None: |
24 |
| -# return None # no source found |
| 9 | +# https://github.com/cython/cython/pull/6341 |
25 | 10 | #
|
26 |
| -# |
27 |
| - |
28 | 11 | set -o errexit
|
29 | 12 |
|
30 |
| -source bin/activate |
31 |
| - |
32 |
| -export PYTHON_FLINT_COVERAGE=true |
33 |
| - |
34 |
| -# Force a rebuild of everything with coverage tracing enabled: |
35 |
| -# touch src/flint/flintlib/* |
36 |
| - |
37 |
| -python setup.py build_ext --inplace |
38 |
| - |
39 |
| -coverage run -m flint.test $@ |
40 |
| - |
41 |
| -#coverage report -m |
| 13 | +meson configure build -Dcoverage=true |
| 14 | +spin run -- coverage run -m flint.test |
| 15 | +coverage report -m |
42 | 16 | coverage html
|
0 commit comments