File tree Expand file tree Collapse file tree 3 files changed +13
-175
lines changed Expand file tree Collapse file tree 3 files changed +13
-175
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -27,13 +27,6 @@ def read(*names, **kwargs):
27
27
return fh .read ()
28
28
29
29
30
- # Enable code coverage for C code: we can't use CFLAGS=-coverage in tox.ini, since that may mess with compiling
31
- # dependencies (e.g. numpy). Therefore we set SETUPPY_CFLAGS=-coverage in tox.ini and copy it to CFLAGS here (after
32
- # deps have been safely installed).
33
- if 'TOXENV' in os .environ and 'SETUPPY_CFLAGS' in os .environ :
34
- os .environ ['CFLAGS' ] = os .environ ['SETUPPY_CFLAGS' ]
35
-
36
-
37
30
class optional_build_ext (build_ext ):
38
31
"""Allow the building of C extensions to fail."""
39
32
def run (self ):
@@ -124,7 +117,9 @@ def _unavailable(self, e):
124
117
Extension (
125
118
splitext (relpath (path , 'src' ).replace (os .sep , '.' ))[0 ],
126
119
sources = [path ],
127
- include_dirs = [dirname (path )]
120
+ extra_compile_args = os .environ .get ('SETUPPY_CFLAGS' , '' ).split (),
121
+ extra_link_args = os .environ .get ('SETUPPY_LFLAGS' , '' ).split (),
122
+ include_dirs = [dirname (path )],
128
123
)
129
124
for root , _ , _ in os .walk ('src' )
130
125
for path in glob (join (root , '*.c' ))
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ envlist =
10
10
ignore_basepython_conflict = true
11
11
12
12
[testenv]
13
- wheel = true
14
13
basepython =
15
14
pypy: {env:TOXPYTHON:pypy}
16
15
pypy3: {env:TOXPYTHON:pypy3}
@@ -24,9 +23,16 @@ basepython =
24
23
setenv =
25
24
PYTHONPATH ={toxinidir}/tests
26
25
PYTHONUNBUFFERED =yes
26
+ cover: SETUPPY_CFLAGS =-fprofile-arcs -ftest-coverage
27
+ cover: SETUPPY_LFLAGS =-lgcov
27
28
passenv =
28
29
*
29
- usedevelop = false
30
+ usedevelop =
31
+ cover: true
32
+ nocov: false
33
+ wheel =
34
+ cover: false
35
+ nocov: true
30
36
deps =
31
37
pytest
32
38
pytest-benchmark
@@ -100,7 +106,8 @@ deps =
100
106
codecov
101
107
skip_install = true
102
108
commands =
103
- codecov []
109
+ codecov --gcov-root =. []
110
+
104
111
105
112
[testenv:report]
106
113
deps = coverage
@@ -113,45 +120,3 @@ commands =
113
120
commands = coverage erase
114
121
skip_install = true
115
122
deps = coverage
116
-
117
-
118
- [testenv:py27-cover]
119
- setenv =
120
- SETUPPY_CFLAGS =-coverage
121
- usedevelop = true
122
-
123
-
124
- [testenv:py35-cover]
125
- setenv =
126
- SETUPPY_CFLAGS =-coverage
127
- usedevelop = true
128
-
129
-
130
- [testenv:py36-cover]
131
- setenv =
132
- SETUPPY_CFLAGS =-coverage
133
- usedevelop = true
134
-
135
-
136
- [testenv:py37-cover]
137
- setenv =
138
- SETUPPY_CFLAGS =-coverage
139
- usedevelop = true
140
-
141
-
142
- [testenv:py38-cover]
143
- setenv =
144
- SETUPPY_CFLAGS =-coverage
145
- usedevelop = true
146
-
147
-
148
- [testenv:pypy-cover]
149
- setenv =
150
- SETUPPY_CFLAGS =-coverage
151
- usedevelop = true
152
-
153
-
154
- [testenv:pypy3-cover]
155
- setenv =
156
- SETUPPY_CFLAGS =-coverage
157
- usedevelop = true
You can’t perform that action at this time.
0 commit comments