File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ [run]
2
+ plugins = Cython.Coverage
Original file line number Diff line number Diff line change 23
23
24
24
from setuptools import Extension , find_packages , setup
25
25
26
- EXTENSION_OPTS = {}
26
+ EXTENSION_OPTS = dict ( compiler_directives = {})
27
27
28
28
# Make sure conda prefix is loaded if installed in a conda environment.
29
29
CONDA_PREFIX = os .environ .get ("CONDA_PREFIX" )
30
30
if CONDA_PREFIX :
31
31
EXTENSION_OPTS ["include_dirs" ] = [os .path .join (CONDA_PREFIX , "include" )]
32
32
33
+ CYTHON_COVERAGE = os .environ .get ("CYTHON_COVERAGE" , False )
34
+ if CYTHON_COVERAGE :
35
+ EXTENSION_OPTS ["compiler_directives" ]["linetrace" ] = True
36
+ EXTENSION_OPTS ["define_macros" ] = [("CYTHON_TRACE" , 1 )]
37
+
33
38
setup (
34
39
name = "isal" ,
35
40
version = "0.1.0-dev" ,
45
50
zip_safe = False ,
46
51
packages = find_packages ('src' ),
47
52
package_dir = {'' : 'src' },
48
- package_data = {'isal' : ['*.pxd' ]},
53
+ package_data = {'isal' : ['*.pxd' , '*.pyx' ]},
49
54
url = "https://github.com/rhpvorderman/python-isal" ,
50
55
classifiers = [
51
56
"Programming Language :: Python :: 3 :: Only" ,
Original file line number Diff line number Diff line change 20
20
21
21
# cython: language_level=3
22
22
23
+
23
24
import warnings
24
25
import zlib
25
26
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
+ setenv =
7
+ CYTHON_COVERAGE =True
6
8
deps =coverage
7
9
pytest
10
+ cython
11
+ allowlist_externals =
12
+ cp
8
13
commands =
9
14
# Create HTML coverage report for humans and xml coverage report for external services.
10
- coverage run --source =isal -m py.test -v tests
15
+ coverage run --source ={envsitepackagesdir}/ isal -m py.test -v tests
11
16
coverage html
12
17
coverage xml
18
+ cython --annotate-coverage coverage.xml {envsitepackagesdir}/isal/isal_zlib.pyx
19
+ cp {envsitepackagesdir}/isal/isal_zlib.html htmlcov/
13
20
14
21
[testenv:lint]
15
22
deps =flake8
You can’t perform that action at this time.
0 commit comments