Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[run]
source = linearmodels
branch = True
omit =
*/results/*
*/_version.py
*/compat/*
*/conftest.py
plugins = Cython.Coverage

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
except NotImplementedError
raise AssertionError

# Ignore pass
pass

# Do not complain about missing debug-only code:
def __repr__
if self\\.debug

# Ignore failure messages
pytest.xfail

# Ignore ImportError protection
raise ImportError
except ImportError

# Ignore type checking code
if TYPE_CHECKING
elif TYPE_CHECKING

# Cython function declarations
cdef

# Cython functions with void
cdef void

# Numba jit decorators
@jit

# Do not complain if non-runnable code is not run:
if 0:
if __name__ == .__main__.:

include = */linearmodels/*
omit =
*/_version.py
*/compat/*
*recursions.py
*samplers.py
ignore_errors = True

[html]
directory = coverage_html_report
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ variables:
PYTHONHASHSEED: 12345678 # Ensure tests are correctly gathered by xdist
TEST_INSTALL: false
MPLBACKEND: agg
PYTEST_PATTERN: "(not slow)"
coverage: true
test.install: false
pip.pre: false
Expand Down
28 changes: 19 additions & 9 deletions ci/azure_template_posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
python310_minimums_wheel:
python310_minimums:
python.version: '3.10'
NUMPY: 1.22.3
SCIPY: 1.8.0
PANDAS: 1.3.0
STATSMODELS: 0.13.1
XARRAY: 0.21.0
FORMULAIC: 1.2.1
test.wheel: true
PYTEST_PATTERN: "(slow or not slow)"
python310_mid_sdist:
python.version: '3.10'
NUMPY: 1.23.0
Expand Down Expand Up @@ -62,11 +62,15 @@ jobs:
XXHASH: true
PYARROW: true
BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
python312_cython_coverage:
python.version: '3.12'
BUILD_FLAGS: '-Csetup-args=-Dcython-coverage=true'
cython.coverage: true
python313_latest:
python.version: '3.13'
XXHASH: true
PYARROW: true
BUILD_FLAGS: '-Csetup-args=-Dcython-coverage=true'
PYTEST_PATTERN: "(slow or not slow)"
python313_copy_on_write:
python.version: '3.12'
XXHASH: true
Expand All @@ -92,8 +96,7 @@ jobs:
jupyter kernelspec list
displayName: 'Install dependencies'

- script: |
python -m pip list
- script: python -m pip list
displayName: 'List Configuration'

- script: |
Expand Down Expand Up @@ -126,6 +129,13 @@ jobs:
displayName: 'Install linearmodels (editable)'
condition: and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true'))

- script: |
pushd linearmodels/panel
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
popd
displayName: 'Transpile Cython to C for coverage support'
condition: eq(variables['cython.coverage'], 'true')

- script: |
echo "Testing site packages"
mkdir test_run_dir
Expand All @@ -137,16 +147,16 @@ jobs:

- script: |
echo "Testing editable install"
export COVERAGE_OPTS="--cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${BUILD_FLAGS} linearmodels/tests
export COVERAGE_OPTS="--cov-config=.coveragerc --cov=linearmodels --cov-branch --cov-report xml:coverage.xml --cov-report term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
displayName: 'Run tests (editable)'
condition: and(and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true')), ne(variables['pip.pre'], 'true'))

- script: |
echo "Testing pip-pre"
export COVERAGE_OPTS="--cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${BUILD_FLAGS} linearmodels/tests
export COVERAGE_OPTS="--cov-config=.coveragerc --cov=linearmodels --cov-branch --cov-report=xml:coverage.xml --cov-report=term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
displayName: 'Run tests (pip pre)'
condition: eq(variables['pip.pre'], 'true')
Expand Down
13 changes: 7 additions & 6 deletions linearmodels/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ inc_np = include_directories(incdir_numpy, is_system: true)
# Copy the main __init__.py to the build dir.
# Some submodules (linalg, special, optimize) add pxd files to this.
# Needed to trick Cython, it won't do a relative import outside a package
_cython_tree = [fs.copyfile('__init__.py')]
cython_args = [
'-Xcpow=True',
'-Xboundscheck=False',
'-Xwraparound=False',
'-Xcdivision=True',
'-Xbinding=True'
'-X cpow=True',
'-X boundscheck=False',
'-X wraparound=False',
'-X cdivision=True',
'-X binding=True'
]
cython_c_args = ['-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION']
if get_option('cython-coverage')
message('Building with Cython coverage support')
cython_args += ['-Xlinetrace=True']
cython_args += ['-X linetrace=True']
cython_c_args += ['-DCYTHON_TRACE=1']
endif

Expand Down
2 changes: 1 addition & 1 deletion linearmodels/panel/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if not get_option('no-binary')
install: true,
include_directories: [inc_np],
subdir: 'linearmodels/panel',
cython_args: cython_args,
c_args: cython_c_args,
cython_args: cython_args,
)
endif
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ include_trailing_comma=true
use_parentheses=true

[tool.coverage.run]
source = ["linearmodels"]
source = [ "linearmodels" ]
branch = true
plugins = ["Cython.Coverage"]
plugins = [ "Cython.Coverage" ]
omit = [
# Version file
"*/_version.py",
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black[jupyter]==24.4.0
black[jupyter]~=25.9.0
coverage
flake8
isort
Expand Down
Empty file removed setup.cfg
Empty file.
108 changes: 0 additions & 108 deletions setup.py

This file was deleted.

Loading