-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage measurement for Cython code #182
Comments
I've made a repo that demonstrates how to get working Cython coverage with setuptools but also shows what does not work with spin: At least some change in Cython's coverage plugin is needed. Also possibly the way that spin/meson generate the .c files results in them containing the wrong path. |
@oscarbenjamin I'd like to see Cython coverage work. I'm a bit tied up for the next few days, but will take a look after that, if you haven't found a solution by then already. |
The primary blocker to Cython code coverage with spin/meson is that changes are needed in Cython's coverage plugin. I opened a related Cython issue cython/cython#6186. |
I have described in cython/cython#6186 (comment) how I think we can make coverage work with Cython for a spin/meson-based project. I think that the proper solution is that spin/meson needs to make something like a json file that tells the coverage plugin where all the files are. |
Currently
spin test
supports--coverage
and--gcov
arguments for measuring coverage of python or C code respectively. For python-flint the one outstanding item in moving from setuptools to spin/meson is coverage measurement of Cython code.A meson project needs to have some sort of configuration option for coverage of Cython e.g.:
In python-flint's case we need this separately from
b_coverage=true
and spin's--gcov
option because we explicitly do not want to measure coverage of C code (which is all Cython-generated).I'm not sure what the best approach would be for spin to implement
spin test --coverage-cython
given that there is not a standard meson option for this.Maybe spin could configure the
CYTHON_TRACE
andlinetrace
directly?Currently it seems that Cython's coverage plugin does not work in a spin build-install directory which I think is because the plugin tries to look for Cython source files adjacent to the C files. Possibly that is something that needs to be fixed in Cython or maybe it is possible for spin to tell coverage where to find the source files.
The text was updated successfully, but these errors were encountered: