Skip to content

Commit 16496b9

Browse files
committed
Ensure coverage still work on Cython 3.1+ and Python 3.13+
1 parent a51bc12 commit 16496b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,13 @@ def get_cython_extension() -> list[Extension]:
392392
compiler_directives = {"language_level": "3"}
393393

394394
if config.profiling:
395-
define_macros += [("CYTHON_TRACE", "1"), ("CYTHON_TRACE_NOGIL", "1")]
395+
define_macros += [
396+
("CYTHON_TRACE", "1"),
397+
("CYTHON_TRACE_NOGIL", "1"),
398+
# Disable sys.monitoring for Python 3.13+ to enable coverage.py support
399+
# coverage.py doesn't support sys.monitoring yet (Cython 3.1+ issue)
400+
("CYTHON_USE_SYS_MONITORING", "0"),
401+
]
396402
compiler_directives.update(linetrace="true")
397403

398404
include_dirs: list[str] = []

0 commit comments

Comments
 (0)