Skip to content

Commit 4ecda41

Browse files
committed
CI: Generate C for coverage
1 parent e5ef707 commit 4ecda41

File tree

8 files changed

+73
-154
lines changed

8 files changed

+73
-154
lines changed

.coveragerc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[run]
2+
source = linearmodels
3+
branch = True
4+
omit =
5+
*/results/*
6+
*/_version.py
7+
*/compat/*
8+
*/conftest.py
9+
plugins = Cython.Coverage
10+
11+
[report]
12+
# Regexes for lines to exclude from consideration
13+
exclude_lines =
14+
# Have to re-enable the standard pragma
15+
pragma: no cover
16+
17+
# Don't complain if tests don't hit defensive assertion code:
18+
raise NotImplementedError
19+
except NotImplementedError
20+
raise AssertionError
21+
22+
# Ignore pass
23+
pass
24+
25+
# Do not complain about missing debug-only code:
26+
def __repr__
27+
if self\\.debug
28+
29+
# Ignore failure messages
30+
pytest.xfail
31+
32+
# Ignore ImportError protection
33+
raise ImportError
34+
except ImportError
35+
36+
# Ignore type checking code
37+
if TYPE_CHECKING
38+
elif TYPE_CHECKING
39+
40+
# Cython function declarations
41+
cdef
42+
43+
# Cython functions with void
44+
cdef void
45+
46+
# Numba jit decorators
47+
@jit
48+
49+
# Do not complain if non-runnable code is not run:
50+
if 0:
51+
if __name__ == .__main__.:
52+
53+
include = */linearmodels/*
54+
omit =
55+
*/_version.py
56+
*/compat/*
57+
*recursions.py
58+
*samplers.py
59+
ignore_errors = True
60+
61+
[html]
62+
directory = coverage_html_report

ci/azure_template_posix.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ jobs:
131131
132132
- script: |
133133
pushd linearmodels/panel
134-
python _cython_coverage.py build_ext --inplace
134+
cython --verbose -M --fast-fail -3 -X cpow=True -X boundscheck=False -X wraparound=False -X cdivision=True -X binding=True -X linetrace=True _utility.pyx
135135
popd
136-
echo "linearmodels.panel._utility location"
137-
python -c "import linearmodels.panel._utility; print(linearmodels.panel._utility.__file__)"
138136
displayName: 'Build ext for Cython Coverage'
139137
condition: eq(variables['cython.coverage'], 'true')
140138

linearmodels/meson.build

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@ inc_np = include_directories(incdir_numpy, is_system: true)
2929
# Copy the main __init__.py to the build dir.
3030
# Some submodules (linalg, special, optimize) add pxd files to this.
3131
# Needed to trick Cython, it won't do a relative import outside a package
32+
_cython_tree = [fs.copyfile('__init__.py')]
3233
cython_args = [
33-
'-Xcpow=True',
34-
'-Xboundscheck=False',
35-
'-Xwraparound=False',
36-
'-Xcdivision=True',
37-
'-Xbinding=True'
34+
'-X cpow=True',
35+
'-X boundscheck=False',
36+
'-X wraparound=False',
37+
'-X cdivision=True',
38+
'-X binding=True'
3839
]
3940
cython_c_args = ['-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION']
4041
if get_option('cython-coverage')
4142
message('Building with Cython coverage support')
42-
cython_args += ['-Xlinetrace=True']
43+
cython_args += ['-X linetrace=True']
4344
cython_c_args += ['-DCYTHON_TRACE=1']
4445
endif
4546

linearmodels/panel/_cython_coverage.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

linearmodels/panel/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if not get_option('no-binary')
55
install: true,
66
include_directories: [inc_np],
77
subdir: 'linearmodels/panel',
8-
cython_args: cython_args,
98
c_args: cython_c_args,
9+
cython_args: cython_args,
1010
)
1111
endif

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ include_trailing_comma=true
311311
use_parentheses=true
312312

313313
[tool.coverage.run]
314-
source = ["linearmodels"]
314+
source = [ "linearmodels" ]
315315
branch = true
316-
plugins = ["Cython.Coverage"]
316+
plugins = [ "Cython.Coverage" ]
317317
omit = [
318318
# Version file
319319
"*/_version.py",

setup.cfg

Whitespace-only changes.

setup.py

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)