Skip to content

Commit 8139153

Browse files
authored
Merge pull request #812 from bashtage/improve-meson
Improve meson
2 parents 2d75a52 + 906ffb9 commit 8139153

File tree

5 files changed

+32
-23
lines changed

5 files changed

+32
-23
lines changed

arch/meson.build

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import os
77
cwd = os.getcwd()
88
99
# Protect from import errors due to module names
10-
os.chdir(os.path.join("..", "examples"))
10+
os.chdir(os.path.join('..', 'examples'))
1111
import numpy as np
1212
os.chdir(cwd)
1313
@@ -25,20 +25,24 @@ print(incdir)
2525
).stdout().strip()
2626

2727
inc_np = include_directories(incdir_numpy, is_system: true)
28-
_math_pxd = [
29-
]
3028

3129
# Copy the main __init__.py to the build dir.
3230
# Some submodules (linalg, special, optimize) add pxd files to this.
3331
# Needed to trick Cython, it won't do a relative import outside a package
3432
_cython_tree = [fs.copyfile('__init__.py')]
35-
cython_args = []
33+
cython_args = [
34+
'-X cpow=True',
35+
'-X boundscheck=False',
36+
'-X wraparound=False',
37+
'-X cdivision=True',
38+
'-X binding=True'
39+
]
3640
cython_c_args = ['-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION']
3741
if get_option('cython-coverage')
38-
cython_args += ['-Xlinetrace=True']
42+
message('Building with Cython coverage support')
43+
cython_args += ['-X linetrace=True']
3944
cython_c_args += ['-DCYTHON_TRACE=1']
4045
endif
41-
# cython_args += ['--output-file', '@OUTPUT@', '--include-dir', '@BUILD_ROOT@', '@INPUT@']
4246

4347
arch_dir = py.get_install_dir() / 'arch'
4448
# Generate version.py for sdist

arch/univariate/recursions.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!python
22

3-
43
import numpy as np
54

65
cimport numpy as np

ci/azure/install-posix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
fi
1717

1818
python -m pip install --upgrade pip "setuptools>=61" wheel
19-
python -m pip install cython "pytest>=8.4.1,<9" pytest-xdist coverage pytest-cov ipython jupyter notebook nbconvert "property_cached>=1.6.3" black isort flake8 nbconvert setuptools_scm colorama "meson-python>=0.18.0" meson ninja
19+
python -m pip install cython "pytest>=8.4.1,<9" pytest-xdist "coverage[toml]" pytest-cov ipython jupyter notebook nbconvert "property_cached>=1.6.3" black isort flake8 nbconvert setuptools_scm colorama "meson-python>=0.18.0" meson ninja
2020

2121

2222
if [[ -n ${NUMPY} ]]; then CMD="$CMD~=${NUMPY}"; fi;

pyproject.toml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ requires = [
1111
name = "arch"
1212
# Keep syned with requirements.txt
1313
dependencies = [
14-
"numpy>=1.22.3",
14+
"numpy>=1.22.3,<3",
15+
"pandas>=1.4.0",
1516
"scipy>=1.8",
16-
"pandas>=1.4",
17-
"statsmodels>=0.12",
17+
"statsmodels>=0.13.0",
1818
"packaging",
1919
]
2020
authors = [{ name = "Kevin Sheppard", email = "kevin.k.sheppard@gmail.com" }]
2121
classifiers = [
2222
"Development Status :: 5 - Production/Stable",
2323
"Intended Audience :: End Users/Desktop",
2424
"Intended Audience :: Financial and Insurance Industry",
25+
"Intended Audience :: Science/Research",
2526
"Programming Language :: Python :: 3.10",
2627
"Programming Language :: Python :: 3.11",
2728
"Programming Language :: Python :: 3.12",
@@ -125,7 +126,7 @@ dev = [
125126
"colorama",
126127
"flake8",
127128
"flake8-bugbear",
128-
"mypy",
129+
"mypy>=1.3",
129130
"ruff>=0.8.6",
130131
"pyupgrade>=3.4.0",
131132
"jupyterlab-code-formatter",
@@ -143,9 +144,6 @@ changelog = "https://bashtage.github.io/arch/changes.html"
143144
[tool.meson-python.args]
144145
setup = ['--vsenv']
145146

146-
[tool.setuptools.dynamic]
147-
dependencies = { file = ["requirements.txt"] }
148-
149147
[tool.black]
150148
target-version = ['py310', 'py311', 'py312', 'py313']
151149
exclude = '''
@@ -161,8 +159,10 @@ exclude = '''
161159
)
162160
'''
163161

164-
[tool.setuptools_scm]
165-
write_to = "arch/_version.py"
162+
[tool.pyright]
163+
exclude = [
164+
"**/tests/**",
165+
]
166166

167167
[tool.ruff]
168168
line-length = 88
@@ -232,8 +232,6 @@ ignore = [
232232
# Multiple statements on one line (colon) (E701)
233233
"E701",
234234
# Always ignore
235-
# RUF005 Consider `[a, *b]` instead of concatenation - don't like
236-
"RUF005",
237235
# TC do not work with doc building
238236
# Move application import `linearmodels....` into a type-checking block
239237
"TC001",
@@ -251,6 +249,8 @@ ignore = [
251249
"PLR0915", # 21
252250
# Magic number
253251
"PLR2004",
252+
# Like to suggest use [a, *b] instead of [a] + b
253+
"RUF005",
254254
]
255255

256256
[tool.ruff.lint.per-file-ignores]
@@ -265,7 +265,8 @@ ignore = [
265265
minversion = "8.4.1"
266266
testpaths = "arch"
267267
xfail_strict = true
268-
empty_parameter_set_mark = "fail_at_collect"
268+
addopts = "--strict"
269+
empty_parameter_set_mark = "xfail"
269270
filterwarnings = [
270271
"ignore:`formatargspec`:DeprecationWarning:statsmodels",
271272
"ignore:Using or importing:DeprecationWarning",
@@ -298,7 +299,6 @@ markers = [
298299
]
299300

300301

301-
302302
[tool.isort]
303303
profile = "black"
304304
src_paths = ["arch"]
@@ -317,12 +317,13 @@ use_parentheses=true
317317
[tool.coverage.run]
318318
source = ["arch"]
319319
branch = true
320-
plugins = ["Cython.Coverage"]
320+
plugins = [ "Cython.Coverage" ]
321321
omit = [
322322
# Version file
323323
"*/_version.py",
324324
# Compatibility code
325325
"*/compat/*",
326+
"*/conftest.py",
326327
]
327328

328329
[tool.coverage.report]
@@ -346,6 +347,7 @@ exclude_also = [
346347
# Ignore failure messages
347348
"pytest.xfail",
348349
# Ignore ImportError protection
350+
"raise ImportError",
349351
"except ImportError",
350352
# Ignore type checking code
351353
"if TYPE_CHECKING",
@@ -368,11 +370,14 @@ omit = [
368370
"*samplers.py",
369371
]
370372

371-
372373
[tool.coverage.html]
373374
directory = "coverage_html_report"
374375

375376
[tool.mypy]
377+
plugins="numpy.typing.mypy_plugin"
378+
exclude = [
379+
"tests",
380+
]
376381
ignore_missing_imports=true
377382
no_implicit_optional=true
378383
strict_equality=true

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ seaborn
1717
pytest>=8.4.1,<9
1818
pytest-xdist
1919
pytest-cov
20+
pytest-randomly
2021

2122
# formatting
2223
black[jupyter]~=25.1.0

0 commit comments

Comments
 (0)