-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathpixi.toml
More file actions
203 lines (167 loc) · 9.02 KB
/
pixi.toml
File metadata and controls
203 lines (167 loc) · 9.02 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
[workspace]
channels = ["https://prefix.dev/conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
preview = ["pixi-build"]
requires-pixi = ">=0.63.0"
### array-api-extra package definition ###
[package.build.backend]
name = "pixi-build-python"
version = "*"
[package.host-dependencies]
meson-python = "*"
uv = "*" # interfaces with meson-python instead of pip
[package.run-dependencies]
array-api-compat = "*"
### workspace environments ###
[environments]
default = { features = ["py314"], solve-group = "py314" }
lint = { features = ["py314", "lint"], solve-group = "py314" }
docs = { features = ["py314", "docs"], solve-group = "py314" }
tests = { features = ["py314", "tests"], solve-group = "py314" }
tests-py314 = { features = ["py314", "tests"], solve-group = "py314" } # alias of tests
# Some backends may pin numpy; use separate solve-group
dev = { features = ["py314", "lint", "tests", "docs", "dev", "backends"], solve-group = "backends" }
tests-backends = { features = ["py314", "tests", "backends"], solve-group = "backends" }
tests-backends-py311 = { features = ["py311", "tests", "backends"] }
# CUDA not available on free github actions and on some developers' PCs
dev-cuda = { features = ["py314", "lint", "tests", "docs", "dev", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda = { features = ["py314", "tests", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda-py311 = { features = ["py311", "tests", "backends", "cuda-backends"] }
# Ungrouped environments
tests-numpy1 = ["py311", "tests", "numpy1"]
tests-py311 = ["py311", "tests"]
tests-nogil = ["nogil", "tests"]
### default feature definition ###
[dev]
# this pulls in array-api-extra's host and run dependencies
array-api-extra.path = "."
[dependencies]
array-api-extra.path = "."
### non-default feature definitions ###
[feature.lint.dependencies]
typing-extensions = ">=4.15.0"
pylint = ">=4.0.5"
mypy = ">=1.20.2"
basedpyright = ">=1.39.3"
numpydoc = ">=1.10.0,<2"
# import dependencies for mypy:
array-api-strict = ">=2.5,<2.6"
numpy = ">=2.1.3"
hypothesis = ">=6.151.9"
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
dprint = ">=0.50.0,<0.51"
lefthook = ">=2.1.6,<3"
ruff = ">=0.15.11,<0.16"
typos = ">=1.45.1,<2"
actionlint = ">=1.7.12,<2"
blacken-docs = ">=1.20.0,<2"
pytest = ">=9.0.3,<10"
validate-pyproject = ">=0.25,<0.26"
pyrefly = ">=0.62.0,<0.63"
zizmor = ">=1.24.1,<1.25"
# NOTE: don't add cupy, jax, pytorch, or sparse here,
# as they slow down mypy and are not portable across target OSs
[feature.lint.tasks]
lefthook = { cmd = "lefthook", description = "Run lefthook", default-environment = "lint" }
hooks = { cmd = "lefthook install", description = "Install pre-commit hooks", default-environment = "lint" }
pre-commit = { cmd = "lefthook run pre-commit", description = "Run pre-commit checks", default-environment = "lint" }
pylint = { cmd = "pylint array_api_extra", cwd = "src", description = "Lint with pylint", default-environment = "lint" }
mypy = { cmd = "mypy", description = "Type check with mypy", default-environment = "lint" }
pyrefly = { cmd = "pyrefly check", description = "Type check with pyrefly", default-environment = "lint" }
pyright = { cmd = "basedpyright", description = "Type check with basedpyright", default-environment = "lint" }
ruff-check = { cmd = "ruff check --fix", description = "Lint with ruff", default-environment = "lint" }
ruff-format = { cmd = "ruff format", description = "Format with ruff", default-environment = "lint" }
dprint = { cmd = "dprint fmt", description = "Format with dprint", default-environment = "lint" }
typos = { cmd = "typos --write-changes --force-exclude", description = "Fix typos", default-environment = "lint" }
actionlint = { cmd = "actionlint", description = "Lint actions with actionlint", default-environment = "lint" }
zizmor = { cmd = "zizmor .github -p", description = "GHA static analysis with zizmor", default-environment = "lint" }
blacken-docs = { cmd = "blacken-docs", description = "Format Python markdown blocks with Black", default-environment = "lint" }
validate-pyproject = { cmd = "validate-pyproject pyproject.toml", description = "Validate pyproject.toml", default-environment = "lint" }
numpydoc = { cmd = "numpydoc lint", description = "Validate docstrings with numpydoc", default-environment = "lint" }
lint = { cmd = "lefthook run pre-commit --all-files --force", description = "Run all linters", default-environment = "lint" }
[feature.tests.dependencies]
pytest = ">=9.0.3"
pytest-cov = ">=7.1.0"
hypothesis = ">=6.151.9"
array-api-strict = ">=2.5,<2.6"
numpy = ">=1.22.0"
scipy = ">=1.15.2,<2"
[feature.tests.tasks]
tests = { cmd = "pytest -v", description = "Run tests", default-environment = "tests" }
tests-cov = { cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20", description = "Run tests with coverage", default-environment = "tests" }
clean-vendor-compat = { cmd = "rm -rf vendor_tests/array_api_compat", description = "Delete the existing vendored version of array-api-compat", default-environment = "tests" }
clean-vendor-extra = { cmd = "rm -rf vendor_tests/array_api_extra", description = "Delete the existing vendored version of array-api-extra", default-environment = "tests" }
copy-vendor-compat = { cmd = "cp -r $(python -c 'import site; print(site.getsitepackages()[0])')/array_api_compat vendor_tests/", depends-on = ["clean-vendor-compat"], description = "Vendor a clean copy of array-api-compat", default-environment = "tests" }
copy-vendor-extra = { cmd = "cp -r src/array_api_extra vendor_tests/", depends-on = ["clean-vendor-extra"], description = "Vendor a clean copy of array-api-extra", default-environment = "tests" }
tests-vendor = { cmd = "pytest -v vendor_tests", depends-on = ["copy-vendor-compat", "copy-vendor-extra"], description = "Check that array-api-extra and array-api-compat can be vendored together", default-environment = "tests" }
tests-ci = { depends-on = ["tests-cov", "tests-vendor"], description = "Run tests with coverage and vendor tests" }
coverage = { cmd = "coverage html", depends-on = ["tests-cov"], description = "Generate test coverage html report", default-environment = "tests" }
open-coverage = { cmd = "open htmlcov/index.html", depends-on = ["coverage"], description = "Open test coverage report", default-environment = "tests" }
[feature.docs.dependencies]
sphinx = ">=7.4.7"
furo = ">=2025.12.19"
myst-parser = ">=5.0.0"
sphinx-copybutton = ">=0.5.2"
sphinx-autodoc-typehints = ">=1.25.3"
# Needed to import parsed modules with autodoc
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
pytest = ">=9.0.3"
typing-extensions = ">=4.15.0"
numpy = ">=2.1.3"
[feature.docs.tasks]
docs = { cmd = "sphinx-build -E -W . build/", cwd = "docs", description = "Build docs", default-environment = "docs" }
open-docs = { cmd = "open build/index.html", cwd = "docs", depends-on = ["docs"], description = "Open the generated docs", default-environment = "docs" }
[feature.dev.dependencies]
ipython = ">=7.33.0"
[feature.dev.tasks]
ipython = { cmd = "ipython", description = "Launch ipython", default-environment = "dev" }
[feature.py311.dependencies]
python = "~=3.11.0"
[feature.py314.dependencies]
python = "~=3.14.0"
[feature.numpy1.dependencies]
# Oldest NumPy version supported by scikit-learn.
# Note that this is older than what SPEC0 recommends.
numpy = "=1.24.1"
# Backends that can run on CPU-only hosts
# Note: JAX and PyTorch will install CPU variants.
[feature.backends.dependencies]
pytorch = ">=2.10.0"
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
sparse = ">=0.18.0"
[feature.backends.target.linux-64.dependencies]
jax = ">=0.9.2"
[feature.backends.target.osx-64.dependencies]
jax = ">=0.9.2"
[feature.backends.target.osx-arm64.dependencies]
jax = ">=0.9.2"
[feature.backends.target.win-64.dependencies]
# jax = "*" # unavailable
# Backends that require a GPU host and a CUDA driver.
# Note that JAX and PyTorch automatically prefer CUDA variants
# thanks to the `system-requirements` below, *if available*.
# We request them explicitly below to ensure that we don't
# quietly revert to CPU-only in the future, e.g. when CUDA 13
# is released and CUDA 12 builds are dropped upstream.
[feature.cuda-backends]
system-requirements = { cuda = "12" }
[feature.cuda-backends.target.linux.dependencies]
cupy = ">=14.0.1"
jaxlib = { version = ">=0.9.2", build = "cuda12*" }
pytorch = { version = ">=2.10.0", build = "cuda12*" }
[feature.cuda-backends.target.osx.dependencies]
# cupy = "*" # unavailable
# jaxlib = { version = "*", build = "cuda12*" } # unavailable
# pytorch = { version = "*", build = "cuda12*" } # unavailable
[feature.cuda-backends.target.win.dependencies]
cupy = ">=14.0.1"
# jaxlib = { version = "*", build = "cuda12*" } # unavailable
pytorch = { version = ">=2.10.0", build = "cuda12*" }
[feature.nogil.dependencies]
python-freethreading = "~=3.13.0"
pytest-run-parallel = ">=0.8.2"
numpy = ">=2.3.5"
# pytorch = "*" # Not available on Python 3.13t yet
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
# sparse = "*" # numba not available on Python 3.13t yet
# jax = "*" # ml_dtypes not available on Python 3.13t yet