Skip to content

Commit e5ef707

Browse files
committed
CI: Attempt to manually get cython coverage
1 parent e210522 commit e5ef707

3 files changed

Lines changed: 108 additions & 62 deletions

File tree

ci/azure_template_posix.yml

Lines changed: 68 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,67 @@ jobs:
1616
vmImage: ${{ parameters.vmImage }}
1717
strategy:
1818
matrix:
19-
python310_minimums_wheel:
20-
python.version: '3.10'
21-
NUMPY: 1.22.3
22-
SCIPY: 1.8.0
23-
PANDAS: 1.3.0
24-
STATSMODELS: 0.13.1
25-
XARRAY: 0.21.0
26-
FORMULAIC: 1.2.1
27-
test.wheel: true
28-
python310_mid_sdist:
29-
python.version: '3.10'
30-
NUMPY: 1.23.0
31-
SCIPY: 1.9.0
32-
PANDAS: 1.4.0
33-
STATSMODELS: 0.13.1
34-
XARRAY: 2022.6.0
35-
XXHASH: true
36-
FORMULAIC: 1.2.1
37-
test.sdist: true
38-
python310_recent_wheel:
39-
python.version: '3.10'
40-
NUMPY: 1.24.0
41-
SCIPY: 1.12.0
42-
PANDAS: 2.0.0
43-
STATSMODELS: 0.14.0
44-
XARRAY: 2023.4.0
45-
FORMULAIC: 1.2.1
46-
test.wheel: true
47-
python310_latest:
48-
python.version: '3.10'
49-
FORMULAIC: 1.2.1
50-
XXHASH: true
51-
PYARROW: true
52-
python311_latest:
53-
python.version: '3.11'
54-
XXHASH: true
55-
PYARROW: true
56-
python312_latest:
57-
python.version: '3.12'
58-
XXHASH: true
59-
PYARROW: true
60-
python312_latest_no_binary:
61-
python.version: '3.12'
62-
XXHASH: true
63-
PYARROW: true
64-
BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
65-
python313_latest:
19+
# python310_minimums_wheel:
20+
# python.version: '3.10'
21+
# NUMPY: 1.22.3
22+
# SCIPY: 1.8.0
23+
# PANDAS: 1.3.0
24+
# STATSMODELS: 0.13.1
25+
# XARRAY: 0.21.0
26+
# FORMULAIC: 1.2.1
27+
# test.wheel: true
28+
# python310_mid_sdist:
29+
# python.version: '3.10'
30+
# NUMPY: 1.23.0
31+
# SCIPY: 1.9.0
32+
# PANDAS: 1.4.0
33+
# STATSMODELS: 0.13.1
34+
# XARRAY: 2022.6.0
35+
# XXHASH: true
36+
# FORMULAIC: 1.2.1
37+
# test.sdist: true
38+
# python310_recent_wheel:
39+
# python.version: '3.10'
40+
# NUMPY: 1.24.0
41+
# SCIPY: 1.12.0
42+
# PANDAS: 2.0.0
43+
# STATSMODELS: 0.14.0
44+
# XARRAY: 2023.4.0
45+
# FORMULAIC: 1.2.1
46+
# test.wheel: true
47+
# python310_latest:
48+
# python.version: '3.10'
49+
# FORMULAIC: 1.2.1
50+
# XXHASH: true
51+
# PYARROW: true
52+
# python311_latest:
53+
# python.version: '3.11'
54+
# XXHASH: true
55+
# PYARROW: true
56+
# python312_latest:
57+
# python.version: '3.12'
58+
# XXHASH: true
59+
# PYARROW: true
60+
# python312_latest_no_binary:
61+
# python.version: '3.12'
62+
# XXHASH: true
63+
# PYARROW: true
64+
# BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
65+
python313_cython_coverage:
6666
python.version: '3.13'
67-
XXHASH: true
68-
PYARROW: true
6967
BUILD_FLAGS: '-Csetup-args=-Dcython-coverage=true'
70-
python313_copy_on_write:
71-
python.version: '3.12'
72-
XXHASH: true
73-
LM_TEST_COPY_ON_WRITE: 1
74-
python313_pre:
75-
python.version: '3.13'
76-
pip.pre: true
68+
cython.coverage: true
69+
# python313_latest:
70+
# python.version: '3.13'
71+
# XXHASH: true
72+
# PYARROW: true
73+
# python313_copy_on_write:
74+
# python.version: '3.12'
75+
# XXHASH: true
76+
# LM_TEST_COPY_ON_WRITE: 1
77+
# python313_pre:
78+
# python.version: '3.13'
79+
# pip.pre: true
7780
maxParallel: 10
7881

7982
steps:
@@ -126,6 +129,15 @@ jobs:
126129
displayName: 'Install linearmodels (editable)'
127130
condition: and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true'))
128131
132+
- script: |
133+
pushd linearmodels/panel
134+
python _cython_coverage.py build_ext --inplace
135+
popd
136+
echo "linearmodels.panel._utility location"
137+
python -c "import linearmodels.panel._utility; print(linearmodels.panel._utility.__file__)"
138+
displayName: 'Build ext for Cython Coverage'
139+
condition: eq(variables['cython.coverage'], 'true')
140+
129141
- script: |
130142
echo "Testing site packages"
131143
mkdir test_run_dir

ci/azure_template_windows.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
vmImage: ${{ parameters.vmImage }}
1717
strategy:
1818
matrix:
19-
python310_win_latest:
20-
python.version: '3.10'
21-
python311_win_latest:
22-
python.version: '3.11'
23-
python312_win_latest:
24-
python.version: '3.12'
19+
# python310_win_latest:
20+
# python.version: '3.10'
21+
# python311_win_latest:
22+
# python.version: '3.11'
23+
# python312_win_latest:
24+
# python.version: '3.12'
2525
python313_win_latest:
2626
python.version: '3.13'
2727
maxParallel: 10
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python3
2+
3+
# Usage: python _cython_coverage.py build_ext --inplace
4+
5+
6+
from setuptools import Extension
7+
from Cython.Build import cythonize
8+
from setuptools import setup
9+
import numpy as np
10+
11+
np_inc = np.get_include()
12+
DIRECTIVES = {
13+
"language_level": "3",
14+
"cpow": True,
15+
"linetrace": True,
16+
"boundscheck": False,
17+
"wraparound": False,
18+
"cdivision": True,
19+
"binding": True,
20+
}
21+
MACROS = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), ("CYTHON_TRACE", "1")]
22+
23+
ext_modules = [
24+
Extension(
25+
"_utility",
26+
["_utility.pyx"],
27+
define_macros=MACROS,
28+
include_dirs=[np_inc],
29+
)
30+
]
31+
32+
setup(
33+
ext_modules=cythonize(ext_modules, force=True, compiler_directives=DIRECTIVES)
34+
)

0 commit comments

Comments
 (0)