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):
2727 return fh .read ()
2828
2929
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-
3730class optional_build_ext (build_ext ):
3831 """Allow the building of C extensions to fail."""
3932 def run (self ):
@@ -124,7 +117,9 @@ def _unavailable(self, e):
124117 Extension (
125118 splitext (relpath (path , 'src' ).replace (os .sep , '.' ))[0 ],
126119 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 )],
128123 )
129124 for root , _ , _ in os .walk ('src' )
130125 for path in glob (join (root , '*.c' ))
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ envlist =
1010ignore_basepython_conflict = true
1111
1212[testenv]
13- wheel = true
1413basepython =
1514 pypy: {env:TOXPYTHON:pypy}
1615 pypy3: {env:TOXPYTHON:pypy3}
@@ -24,9 +23,16 @@ basepython =
2423setenv =
2524 PYTHONPATH ={toxinidir}/tests
2625 PYTHONUNBUFFERED =yes
26+ cover: SETUPPY_CFLAGS =-fprofile-arcs -ftest-coverage
27+ cover: SETUPPY_LFLAGS =-lgcov
2728passenv =
2829 *
29- usedevelop = false
30+ usedevelop =
31+ cover: true
32+ nocov: false
33+ wheel =
34+ cover: false
35+ nocov: true
3036deps =
3137 pytest
3238 pytest-benchmark
@@ -100,7 +106,8 @@ deps =
100106 codecov
101107skip_install = true
102108commands =
103- codecov []
109+ codecov --gcov-root =. []
110+
104111
105112[testenv:report]
106113deps = coverage
@@ -113,45 +120,3 @@ commands =
113120commands = coverage erase
114121skip_install = true
115122deps = 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