python-libzim icon indicating copy to clipboard operation
python-libzim copied to clipboard

Use `sys.monitoring` once coverage.py supports it

Open benoit74 opened this issue 2 weeks ago • 0 comments

In https://github.com/openzim/python-libzim/pull/237/commits/036a5ec8df389d021979a253f299773975233a23, we've made configuration changes to ensure coverage still works with Cython 3.1

The issue is that:

  • coverage has switched to sys.monitoring core to collect profile / linetracing in 7.9.1 on Python 3.14+: https://coverage.readthedocs.io/en/latest/changes.html#version-7-9-1-2025-06-13
  • Cython also uses sys.monitoring profile / linetracing by default since 3.1 (see https://github.com/cython/cython/pull/6144)

The commit referenced above hence asked:

  • coverage to use the ctrace core
  • Cython to not use sys.monitoring for profile / linetracing

This needs to be rolled-back (to use sys.monitoring which is expected to be way more performant) once coverage supports plugins with sys.monitoring (probably https://github.com/nedbat/coveragepy/issues/1790 is the issue to follow).

benoit74 avatar Nov 06 '25 08:11 benoit74