File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
[build-system ]
2
2
requires = [" setuptools>=51" , " cython>=0.29" , " wheel" ]
3
3
build-backend = " setuptools.build_meta"
4
+
5
+ [tool .coverage .run ]
6
+ plugins = [" Cython.Coverage" ]
Original file line number Diff line number Diff line change 25
25
import tempfile
26
26
from pathlib import Path
27
27
28
+ from Cython .Build import cythonize
29
+
28
30
from setuptools import Extension , find_packages , setup
29
31
from setuptools .command .build_ext import build_ext
30
32
@@ -62,6 +64,17 @@ def build_extension(self, ext):
62
64
ext .extra_objects = [
63
65
os .path .join (isa_l_prefix_dir , "lib" , "libisal.a" )]
64
66
67
+ if os .getenv ("CYTHON_COVERAGE" ) is not None :
68
+ # Add cython directives and macros for coverage support.
69
+ cythonized_exts = cythonize (ext , compiler_directives = dict (
70
+ linetrace = True
71
+ ))
72
+ for cython_ext in cythonized_exts :
73
+ cython_ext .define_macros = [("CYTHON_TRACE_NOGIL" , "1" )]
74
+ cython_ext ._needs_stub = False
75
+ super ().build_extension (cython_ext )
76
+ return
77
+
65
78
super ().build_extension (ext )
66
79
67
80
Original file line number Diff line number Diff line change 3
3
# python3 interpreter of the user.
4
4
envlist =py3
5
5
[testenv]
6
- deps =coverage
6
+ deps =coverage[toml]
7
+ cython
7
8
pytest
8
9
passenv =
9
10
PYTHON_ISAL_LINK_DYNAMIC
11
+ setenv =
12
+ CYTHON_COVERAGE =true
10
13
commands =
11
14
# Create HTML coverage report for humans and xml coverage report for external services.
12
15
coverage run --source ={envsitepackagesdir}/isal -m py.test -v tests
You can’t perform that action at this time.
0 commit comments