-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
204 lines (169 loc) · 6.12 KB
/
pyproject.toml
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
[project]
name = "fastcan"
version = "0.3.0"
description = "A fast canonical-correlation-based feature selection method"
authors = [
{ name = "Matthew Sikai Zhang", email = "[email protected]" },
]
requires-python = ">=3.10"
readme = "README.rst"
license = { file = "LICENSE" }
dependencies = ["scikit-learn>=1.6.0"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]
[project.urls]
homepage = "https://fastcan.readthedocs.io/en/latest/"
source = "https://github.com/scikit-learn-contrib/fastcan"
download = "https://pypi.org/project/fastcan/#files"
tracker = "https://github.com/scikit-learn-contrib/fastcan/issues"
[project.optional-dependencies]
docs = ["furo", "matplotlib", "sphinx_gallery", "sphinx-design"]
[build-system]
requires = ["meson-python>=0.16.0", "Cython>=3.0.10", "scikit-learn>=1.6.0"]
build-backend = "mesonpy"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
[tool.pixi.dependencies]
python = ">=3.13.0"
scikit-learn = ">=1.6.0"
[tool.pixi.pypi-dependencies]
fastcan = { path = ".", editable = true }
[tool.pixi.build-dependencies]
cython = ">=3.0.10"
meson-python = ">=0.16.0"
ninja = ">=1.12.1"
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pandas = "*"
[tool.pixi.feature.fmt.dependencies]
black = "*"
[tool.pixi.feature.lint.dependencies]
ruff = "*"
cython-lint = "*"
[tool.pixi.feature.type.dependencies]
mypy = "*"
[tool.pixi.feature.build.dependencies]
python-build = "*"
uv = "*"
[tool.pixi.feature.nogil.dependencies]
python-freethreading = "*"
pip = "*"
meson-python = "*"
joblib = "*"
threadpoolctl = "*"
[tool.pixi.target.osx-64.build-dependencies]
compilers = "*"
[tool.pixi.target.osx-arm64.build-dependencies]
compilers = "*"
[tool.pixi.tasks]
time-h = "python -m timeit -n 5 -s 'import numpy as np; from fastcan import FastCan; X = np.random.rand(3000, 100); y = np.random.rand(3000, 20)' 's = FastCan(100, verbose=0).fit(X, y)'"
time-eta = "python -m timeit -n 5 -s 'import numpy as np; from fastcan import FastCan; X = np.random.rand(3000, 100); y = np.random.rand(3000, 20)' 's = FastCan(100, eta=True, verbose=0).fit(X, y)'"
[tool.pixi.feature.test.tasks]
test = { cmd = "pytest", cwd = "tests" }
test-coverage = { cmd = "rm -rf .coverage && pytest --cov-report $FMT --cov=$PACKAGE tests/", env = { PACKAGE = "fastcan", FMT = "html" } }
[tool.pixi.feature.build.tasks]
build-wheel = "rm -rf dist && python -m build -wnx -Cinstall-args=--tags=runtime,python-runtime,devel"
build-sdist = "rm -rf dist && python -m build --sdist"
rebuild = "rm -rf build && uv pip install --no-deps --force-reinstall -e ."
[tool.pixi.feature.fmt.tasks]
fmt = { cmd = "black .", cwd = "fastcan" }
[tool.pixi.feature.lint.tasks]
lint = "ruff check . --fix"
cython-lint = { cmd = "cython-lint .", cwd = "fastcan" }
[tool.pixi.feature.type.tasks]
type = { cmd = "mypy . --ignore-missing-imports", cwd = "fastcan" }
[tool.pixi.feature.docs.tasks]
doc = { cmd = "$SPHINXBUILD -M $CMD $SOURCEDIR $BUILDDIR $SPHINXOPTS", cwd = "doc", env = { SPHINXBUILD = "sphinx-build", CMD = "html", SOURCEDIR = ".", BUILDDIR = "_build", SPHINXOPTS = "" } }
doc-clean = { cmd = "rm -rf $BUILDDIR generated auto_examples", cwd = "doc", env = { BUILDDIR = "_build" } }
[tool.pixi.feature.nogil.tasks]
install-scikit-learn = "pip install scikit-learn" # TODO: change to pypi-dependencies after pixi update
nogil-build = { cmd = "pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true", depends_on = [
"install-scikit-learn",
] }
nogil-h = { cmd = "python -Xgil=0 -m timeit -n 5 -s 'import numpy as np; from fastcan import FastCan; X = np.random.rand(3000, 100); y = np.random.rand(3000, 20)' 's = FastCan(100, verbose=0).fit(X, y)'", depends_on = [
"nogil-build",
] }
nogil-eta = { cmd = "python -Xgil=0 -m timeit -n 5 -s 'import numpy as np; from fastcan import FastCan; X = np.random.rand(3000, 100); y = np.random.rand(3000, 20)' 's = FastCan(100, eta=True, verbose=0).fit(X, y)'", depends_on = [
"nogil-build",
] }
[tool.pixi.environments]
dev = ["docs", "test", "build"]
lint = { features = ["fmt", "lint", "type"], no-default-feature = true }
nogil = { features = ["nogil"], no-default-feature = true }
[tool.black]
line-length = 88
preview = true
exclude = '''
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.mypy_cache
| \.vscode
| \.venv
| \.ruff_cache
| build
| dist
| doc/_build
| doc/auto_examples
)/
'''
[tool.ruff]
# all rules can be found here: https://beta.ruff.rs/docs/rules/
lint.select = ["E", "F", "W", "I"]
lint.ignore = [
# space before : (needed for how black formats slicing)
"E203",
# do not assign a lambda expression, use a def
"E731",
# do not use variables named 'l', 'O', or 'I'
"E741",
]
# max line length for black
line-length = 88
exclude = [
".git",
"__pycache__",
"dist",
"doc/_build",
"doc/auto_examples",
"build",
]
[tool.ruff.lint.per-file-ignores]
# It's fine not to put the import at the top of the file in the examples
# folder.
"examples/*" = ["E402"]
"doc/conf.py" = ["E402"]
[tool.cython-lint]
# Ignore the same error codes as ruff
# + E501 (line too long) because keeping it < 88 in cython
# often makes code less readable.
lint.ignore = [
# multiple spaces/tab after comma
'E24',
# space before : (needed for how black formats slicing)
'E203',
# line too long
'E501',
# do not assign a lambda expression, use a def
'E731',
# do not use variables named 'l', 'O', or 'I'
'E741',
# line break before binary operator
'W503',
# line break after binary operator
'W504',
]