You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported byIoannis Filippidis (Bitbucket: johnyf, GitHub: johnyf)
coverage.py cannot parse Cython code. Running coverage xml -i produces the warning Coverage.py warning: Could not parse Python file /path/dd/dd/cudd.pyx, which is a warning discussed in #396.
Without the -i option the output is Couldn't parse '/path/github/dd/dd/cudd.pyx' as Python source: 'invalid syntax' at line 27, where line 27 reads from libcpp cimport bool. (I am aware of Cython's annotating capability for coverage results, but that too takes xml as input.)
Does coverage.py support Cython? If not, are there any future plans in that direction?
Original comment byIoannis Filippidis (Bitbucket: johnyf, GitHub: johnyf)
It turns out that even though my .coveragerc included the Cython plugin, it was under the tests/ directory (where I run tests on the installed package), but I was attempting to collect coverage measurements while outside the tests directory (because building in-place is required). Copying .coveragerc to the directory where I run nosetests resolved the issue.
It would be great to see #597 being resolved. For the time being I cannot get [paths] to work properly when running nosetests within the tests/ directory, unless I manually edit the paths within the generated .coverageand copy the resulting .coverage file to outside the tests/ directory (even when all the paths are absolute).
It is interesting that running from within tests/ with the package installed as normal does collect statistics for pyx files, but does not insert "file_tracers":{"/path/dd/dd/cudd.pyx" in the .coverage file. Adding this to the file, replacing the paths with the correct absolute paths, then moving the resulting .coverage to the parent directory (from where the built-in-place dd/*.so are visible), and running coverage xml works.
Originally reported by Ioannis Filippidis (Bitbucket: johnyf, GitHub: johnyf)
coverage.py
cannot parse Cython code. Runningcoverage xml -i
produces the warningCoverage.py warning: Could not parse Python file /path/dd/dd/cudd.pyx
, which is a warning discussed in #396.Without the
-i
option the output isCouldn't parse '/path/github/dd/dd/cudd.pyx' as Python source: 'invalid syntax' at line 27
, where line 27 readsfrom libcpp cimport bool
. (I am aware of Cython's annotating capability for coverage results, but that too takesxml
as input.)Does
coverage.py
support Cython? If not, are there any future plans in that direction?Relevant also to: cython/cython#1508
The text was updated successfully, but these errors were encountered: