Skip to content

Commit 4d12d36

Browse files
committed
Update bin/coverage.sh to use meson
1 parent a6107be commit 4d12d36

File tree

2 files changed

+9
-37
lines changed

2 files changed

+9
-37
lines changed

.github/workflows/buildwheel.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,9 @@ jobs:
149149
python-version: '3.12'
150150
- run: sudo apt-get update
151151
- run: sudo apt-get install libflint-dev
152-
- run: pip install cython setuptools coverage
152+
- run: pip install git+https://github.com/oscarbenjamin/cython.git@pr_relative_paths
153+
- run: pip install -r requirements-dev.txt
153154
- run: bin/coverage.sh
154-
env:
155-
PYTHONPATH: src
156-
- run: coverage report --sort=cover
157155

158156
# Run SymPy test suite against python-flint master
159157
test_sympy:

bin/coverage.sh

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,16 @@
11
#!/bin/bash
22
#
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:
54
#
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
96
#
10-
# A patch to the file is needed:
7+
# That patch has been submitted as a pull request:
118
#
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
2510
#
26-
#
27-
2811
set -o errexit
2912

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
4216
coverage html

0 commit comments

Comments
 (0)