Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
334 lines (307 loc) Β· 8.56 KB
/
Copy pathpyproject.toml
File metadata and controls
334 lines (307 loc) Β· 8.56 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
[project]
name = "river"
version = "0.26.1"
description = "Online machine learning in Python"
authors = [{ name = "Max Halford", email = "maxhalford25@gmail.com" }]
requires-python = ">=3.11"
readme = "README.md"
license = "BSD-3-Clause"
dependencies = [
"scipy>=1.14.1,<2",
"numpy>=2.2.5,<3",
"narwhals>=2.0.0",
]
[project.optional-dependencies]
pandas = [
"pandas>=2.2,<3",
]
[project.urls]
Homepage = "https://riverml.xyz/"
Repository = "https://github.com/online-ml/river/"
[build-system]
requires = ["maturin>=1.13,<2"]
build-backend = "maturin"
[tool.maturin]
module-name = "river._river_rust"
python-source = "."
features = ["pyo3/extension-module"]
include = [
{ path = "river/datasets/*.csv", format = ["sdist", "wheel"] },
{ path = "river/datasets/*.gz", format = ["sdist", "wheel"] },
{ path = "river/datasets/*.zip", format = ["sdist", "wheel"] },
{ path = "river/drift/datasets/*.csv", format = ["sdist", "wheel"] },
]
[dependency-groups]
dev = [
"graphviz>=0.20.1",
"gymnasium>=0.29.0",
"altair>=5.0.0",
"mypy>=1.11.1",
"pandas>=2.2,<3",
"prek>=0.2",
"pytest>=9.0.3",
"ruff>=0.15.8",
"scikit-learn>=1.5.1",
"sqlalchemy>=2.0.22",
"sympy>=1.12.1",
"pytest-xdist[psutil]>=3.3.1",
"jupyter>=1.0.0",
"mike @ git+https://github.com/squidfunk/mike.git",
"polars>=1.1.0",
"pyarrow>=11.0.0",
"import-linter>=2.13",
]
compat = [
"scikit-learn>=1.5.1,<2",
"sqlalchemy>=2.0.0,<3",
]
docs = [
"dominate",
"flask",
"jupyter-client",
"mike @ git+https://github.com/squidfunk/mike.git",
"pygments",
"altair>=5.0.0",
"TA-Lib",
"zensical>=0.0.40",
"nbconvert",
"numpydoc",
"plotly>=6.3.0",
"python-slugify",
"matplotlib",
"tabulate",
"tqdm",
"watermark",
"notebook<7",
"jupyter-contrib-nbextensions>=0.7.0,<0.8",
]
benchmark = [
"asv",
"virtualenv",
]
codspeed = [
"pytest>=9.0.3",
"pytest-codspeed>=5.0.3",
]
[tool.uv]
default-groups = [
"dev",
"compat",
"docs",
"benchmark",
]
[tool.cibuildwheel]
build-frontend = "build[uv]"
skip = ["*_i686", "*-win32", "*-musllinux_i686"]
test-skip = ["*-*linux_ppc64le", "cp315-*"]
test-command = "python -c \"import river.anomaly, river.datasets, river.drift, river.stream, river.tree\""
[tool.cibuildwheel.environment]
PATH = "$HOME/.cargo/bin:$PATH"
MACOSX_DEPLOYMENT_TARGET = "10.13"
[tool.cibuildwheel.linux.environment]
PATH = "$HOME/.cargo/bin:$PATH"
[[tool.cibuildwheel.overrides]]
select = "*-*linux_*"
before-build = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=none --profile=minimal -y && rustup show"
[[tool.cibuildwheel.overrides]]
select = "*-musllinux_ppc64le"
build-frontend = "build"
[[tool.cibuildwheel.overrides]]
select = ["*-macosx_*"]
before-build = "rustup show"
[[tool.cibuildwheel.overrides]]
select = ["*-win_*", "*-win32"]
before-build = "rustup show"
[tool.pytest.ini_options]
addopts = [
"--doctest-modules",
"--doctest-glob=README.md",
"--ignore=build.py",
"--ignore=benchmarks",
"--ignore=docs/scripts",
"--verbose",
"-ra",
"-m not datasets and not slow",
"--color=yes",
]
filterwarnings = [
"ignore:A single label was found in 'y_true' and 'y_pred':UserWarning:sklearn",
]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER ELLIPSIS"
norecursedirs = [
"build",
"docs",
"node_modules",
".eggs",
"scikit-multiflow",
"site",
"benchmarks",
]
markers = [
"codspeed_heavy: CodSpeed benchmarks assigned to the heavy CI shard",
"datasets: tests that pertain to the datasets module",
"slow: tests that take a long time to run",
]
[tool.ruff]
line-length = 100
target-version = 'py310'
extend-include = ["*.ipynb"]
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# isort
"I",
# pep8-naming: class names (N801), function/method names (N802), and the
# cls/self convention on classmethods (N804). N803 (argument names) and
# N806 (local variable names) are deliberately left out β `X: pd.DataFrame`
# and `A_numpy = ...` are conventional in ML/scientific code and would
# produce hundreds of false positives.
"N801",
"N802",
"N804",
]
ignore = ["E501"]
fixable = ["ALL"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"benchmarks/codspeed/python/*.py" = ["I002"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
files = ["river", "tests", "conftest.py"]
strict = true
[[tool.mypy.overrides]]
# Both the bare top-level name and the `.*` submodule glob are listed: under the uv dev env
# (where prek now runs mypy) these libraries are installed without a py.typed marker, so a bare
# `import pandas` reports `import-untyped` unless the top-level name is ignored too.
module = [
"mmh3",
"mmh3.*",
"numpy",
"numpy.*",
"sklearn",
"sklearn.*",
"pytest",
"pytest.*",
"pandas",
"pandas.*",
"scipy",
"scipy.*",
"graphviz",
"graphviz.*",
"vaex",
"vaex.*",
"torch",
"torch.*",
"requests",
"requests.*",
"gymnasium",
"gymnasium.*",
"sympy",
"sympy.*",
"polars",
"polars.*",
"pyarrow",
"pyarrow.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# `numpydoc` (used by docs/parse for docstring scraping) hard-depends on Sphinx, whose source
# uses 3.12 `type` syntax that mypy rejects under `--python-version=3.11`. We build docs with
# mkdocs/zensical, never Sphinx, and never type-check it, so don't follow imports into it.
module = ["sphinx.*", "numpydoc.*"]
follow_imports = "skip"
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Disable strict mode for all non fully-typed modules
module = [
"river.metrics.*",
"river.datasets.*",
"river.tree.*",
"river.preprocessing.*",
"river.stream.*",
"river.linear_model.*",
"river.evaluate.*",
"river.drift.*",
"river.compose.*",
"river.bandit.*",
"river.cluster.*",
"river.anomaly.*",
"river.time_series.*",
"river.feature_extraction.*",
"river.ensemble.*",
"river.proba.*",
"river.multioutput.*",
"river.naive_bayes.*",
"river.checks.*",
"river.rules.*",
"river.model_selection.*",
"river.forest.*",
"river.neighbors.*",
"river.sketch.*",
"river.facto.*",
"river.covariance.*",
"river.compat.river_to_sklearn",
"river.multiclass.*",
"river.reco.*",
"river.imblearn.*",
"river.feature_selection.*",
"river.active.*",
"tests.*",
]
# The strict option is global, the checks must be disabled one by one
warn_unused_ignores = false
check_untyped_defs = false
allow_subclassing_any = true
allow_any_generics = true
allow_untyped_calls = true
allow_incomplete_defs = true
allow_untyped_defs = true
warn_return_any = false
[tool.importlinter]
root_packages = ["river"]
exclude_type_checking_imports = true
[[tool.importlinter.contracts]]
name = "River sub-packages form a DAG"
type = "acyclic_siblings"
ancestors = ["river"]
# TODO: we ignore all these function-local imports for now
# as refactoring them would require a lot of work.
# import-linter has no "ignore function-local" setting
# so we need to list them manually, which is brittle.
# Long-term solution would be to prevent function-local imports
# (enable ruff PLC0415) and solve all the cyclic dependencies
# they create.
ignore_imports = [
"river.active.entropy -> river.tree",
"river.anomaly.filter -> river.preprocessing",
"river.base.base -> river.utils",
"river.base.estimator -> river.compose",
"river.base.transformer -> river.compose",
"river.base.viz -> river.compose",
"river.checks.clf -> river.active.base",
"river.checks.common -> river.active.base",
"river.conf.jackknife -> river.linear_model",
"river.conf.jackknife -> river.preprocessing",
"river.drift.retrain -> river.linear_model",
"river.drift.retrain -> river.naive_bayes",
"river.drift.retrain -> river.preprocessing",
"river.evaluate.forecasting -> river.time_series",
"river.evaluate.progressive_validation -> river.active.base",
"river.model_selection.base -> river.compose",
"river.model_selection.base -> river.linear_model",
"river.model_selection.base -> river.optim",
"river.model_selection.base -> river.preprocessing",
"river.multioutput.chain -> river.neighbors",
"river.multioutput.encoder -> river.tree",
"river.preprocessing.pred_clipper -> river.linear_model",
"river.time_series -> river.evaluate",
"river.tree.base -> river.tree.viz",
]