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
{{ message }}
Repository navigation
[BUG] Shared utility module fails in coverage analysis #7872
When enabling coverage analysis in a package compiled with the shared utility module, coverage.py complains that it cannot find the module source:
File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/coverage/python.py", line 67, in get_python_source
raise NoSource(f"No source for code: '{filename}'.", slug="no-source")
coverage.exceptions.NoSource: No source for code: '/home/runner/work/cython/cython/Cython/_shared.pyx'.
Code to reproduce the behaviour:
No response
Expected behaviour
In general, it is unlikely that users care about the shared utility module when it comes to coverage analysis.
Possible ideas:
The shared module could be ignored in general, but it might be difficult to detect.
All modules for which the source code cannot be found could be marked as excluded, but that might also impact user modules.
Require users to exclude the module themselves in their coverage config.
documentation that shared utility is not good for development and running tests
I'd rather not require users to make their build configurable so that they can build with and without the shared module.
I think excluding it in the coverage config is bad enough, it shouldn't be worse than that.
Activity
matusvalo commentedon Jul 30, 2026
Or just simple discourage users in documentation that shared utility is not good for development and running tests?
scoder commentedon Jul 31, 2026
I'd rather not require users to make their build configurable so that they can build with and without the shared module.
I think excluding it in the coverage config is bad enough, it shouldn't be worse than that.