-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
147 lines (135 loc) · 4.73 KB
/
Copy pathpyproject.toml
File metadata and controls
147 lines (135 loc) · 4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[project]
name = "ovvo-nns"
version = "1.0.8"
description = "Python port of nonlinear nonparametric statistics from R NNS"
readme = "README.md"
requires-python = ">=3.11"
license = "GPL-3.0-only"
authors = [
{ name = "Fred Viole", email = "ovvo.open.source@gmail.com" },
]
maintainers = [
{ name = "Fred Viole", email = "ovvo.open.source@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Typing :: Typed",
]
keywords = [
"statistics",
"nonparametric",
"partial moments",
"regression",
"forecasting",
"nns",
]
urls = { "Homepage" = "https://github.com/OVVO-Financial/NNS-python", "Repository" = "https://github.com/OVVO-Financial/NNS-python", "Source" = "https://github.com/OVVO-Financial/NNS-python", "Issues" = "https://github.com/OVVO-Financial/NNS-python/issues", "Documentation" = "https://ovvo-financial.github.io/NNS-python/" }
dependencies = [
"matplotlib>=3.7",
"numpy",
"scipy",
]
[dependency-groups]
dev = [
"hypothesis",
"mypy",
"pytest",
"pytest-benchmark",
"pytest-cov",
"pytest-xdist>=3.8.0",
"ruff",
]
docs = [
"mkdocs-material>=9.5",
"pymdown-extensions>=10",
]
[build-system]
requires = ["scikit-build-core", "nanobind"]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
wheel.packages = ["src/nns"]
sdist.include = [
"/CMakeLists.txt",
"/LICENSE",
"/README.md",
"/docs",
"/sync",
"/extern/NNS-core",
"/original_tests",
"/scripts",
"/tools/NNS",
"/tools/NNS_13.0.tar.gz",
"/tests/_r_cache.json",
"/tests/fixtures/original_tests_expected.json",
"/pyproject.toml",
"/src",
]
[tool.pytest.ini_options]
addopts = "-ra -m 'not benchmark' --benchmark-disable -n 4"
pythonpath = ["tests"]
testpaths = ["tests"]
markers = [
"benchmark: performance benchmarks excluded from the default test run",
"parity: tests comparing nns behavior to the reference R NNS package",
"practical: end-to-end practical example parity checks against installed R NNS",
"invariant: tests for mathematical or API invariants",
"property: property-based tests",
"stochastic: stochastic structural/statistical tests",
]
[tool.ruff]
line-length = 100
target-version = "py311"
extend-exclude = [
"*.ipynb",
"extern/NNS-core",
"upstream",
"gists",
]
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP", "N", "RUF", "TID"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"subprocess" = { msg = "Do not call subprocess from nns implementation code. Keep R parity calls in tests/_r.py." }
"rpy2" = { msg = "Do not use rpy2 from nns implementation code. Keep R parity calls outside the package." }
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["TID251"]
"scripts/generate_api_reference.py" = ["E501"]
"scripts/regenerate_r_cache.py" = ["TID251"]
"scripts/install_local_r_nns.py" = ["TID251"]
"scripts/run_live_r_parity_for_changed_api.py" = ["TID251"]
"scripts/inspect_r_api_update.py" = ["TID251"]
"scripts/verify_release_provenance.py" = ["TID251"]
# No python_version pin: mypy targets the interpreter it runs under. The CI
# matrix runs mypy on 3.11-3.14, and pinning to 3.11 made mypy reject newer
# numpy stubs that use PEP 695 `type` statements (valid only on 3.12+).
[tool.mypy]
strict = true
files = ["src/nns", "tests"]
mypy_path = ["tests"]
[tool.cibuildwheel]
# Native (C++17 / nanobind) extension: build CPython wheels across 3.11-3.14.
build = "cp311-* cp312-* cp313-* cp314-*"
skip = ["pp*", "*_i686", "*-win32", "*-musllinux_i686"]
build-frontend = "build"
# Build/test on glibc 2.28: numpy/scipy only publish manylinux_2_27/_2_28 wheels,
# so the default manylinux2014 (glibc 2.17) test image cannot install them and
# falls back to compiling scipy from source (no OpenBLAS) and fails. musllinux_1_2
# (the cibuildwheel default) already has matching numpy/scipy wheels.
manylinux-x86_64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
# Smoke-test every built wheel: the native extension imports and computes.
test-command = 'python -c "import nns, nns._nnscore as c; print(c.lpm(2.0, 0.0, [-2.0, -1.0, 0.5, 3.0]))"'
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
# nanobind's C++17 runtime uses aligned new/delete, which requires macOS 10.13+.
# cibuildwheel otherwise defaults x86_64 to 10.9 and the build fails to compile.
environment = { MACOSX_DEPLOYMENT_TARGET = "10.14" }
[tool.cibuildwheel.windows]
archs = ["AMD64"]