Skip to content

Commit c8bf3cd

Browse files
committed
MAINT: move Pixi manifest to separate file
1 parent 2690f22 commit c8bf3cd

2 files changed

Lines changed: 202 additions & 205 deletions

File tree

pixi.toml

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
[workspace]
2+
channels = ["https://prefix.dev/conda-forge"]
3+
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
4+
preview = ["pixi-build"]
5+
6+
### array-api-extra package definition ###
7+
8+
[package.build.backend]
9+
name = "pixi-build-python"
10+
version = "*"
11+
12+
[package.host-dependencies]
13+
meson-python = "*"
14+
uv = "*" # interfaces with meson-python instead of pip
15+
16+
[package.run-dependencies]
17+
array-api-compat = "*"
18+
19+
### workspace environments ###
20+
21+
[environments]
22+
default = { features = ["py314"], solve-group = "py314" }
23+
lint = { features = ["py314", "lint"], solve-group = "py314" }
24+
docs = { features = ["py314", "docs"], solve-group = "py314" }
25+
tests = { features = ["py314", "tests"], solve-group = "py314" }
26+
tests-py314 = { features = ["py314", "tests"], solve-group = "py314" } # alias of tests
27+
28+
# Some backends may pin numpy; use separate solve-group
29+
dev = { features = ["py314", "lint", "tests", "docs", "dev", "backends"], solve-group = "backends" }
30+
tests-backends = { features = ["py314", "tests", "backends"], solve-group = "backends" }
31+
tests-backends-py311 = { features = ["py311", "tests", "backends"] }
32+
33+
# CUDA not available on free github actions and on some developers' PCs
34+
dev-cuda = { features = ["py314", "lint", "tests", "docs", "dev", "backends", "cuda-backends"], solve-group = "cuda" }
35+
tests-cuda = { features = ["py314", "tests", "backends", "cuda-backends"], solve-group = "cuda" }
36+
tests-cuda-py311 = { features = ["py311", "tests", "backends", "cuda-backends"] }
37+
38+
# Ungrouped environments
39+
tests-numpy1 = ["py311", "tests", "numpy1"]
40+
tests-py311 = ["py311", "tests"]
41+
tests-nogil = ["nogil", "tests"]
42+
43+
### default feature definition ###
44+
45+
[dev]
46+
# this pulls in array-api-extra's host and run dependencies
47+
array-api-extra.path = "."
48+
49+
[dependencies]
50+
array-api-extra.path = "."
51+
52+
### non-default feature definitions ###
53+
54+
[feature.lint.dependencies]
55+
typing-extensions = ">=4.15.0"
56+
pylint = ">=4.0.5"
57+
mypy = ">=1.20.0"
58+
basedpyright = ">=1.39.0"
59+
numpydoc = ">=1.10.0,<2"
60+
# import dependencies for mypy:
61+
array-api-strict = ">=2.5,<2.6"
62+
numpy = ">=2.1.3"
63+
hypothesis = ">=6.151.9"
64+
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
65+
dprint = ">=0.50.0,<0.51"
66+
lefthook = ">=2.1.5,<3"
67+
ruff = ">=0.15.9,<0.16"
68+
typos = ">=1.44.0,<2"
69+
actionlint = ">=1.7.12,<2"
70+
blacken-docs = ">=1.20.0,<2"
71+
pytest = ">=9.0.3,<10"
72+
validate-pyproject = ">=0.25,<0.26"
73+
pyrefly = ">=0.61.1,<0.62"
74+
zizmor = ">=1.24.1,<1.25"
75+
# NOTE: don't add cupy, jax, pytorch, or sparse here,
76+
# as they slow down mypy and are not portable across target OSs
77+
78+
[feature.lint.tasks]
79+
lefthook = { cmd = "lefthook", description = "Run lefthook" }
80+
hooks = { cmd = "lefthook install", description = "Install pre-commit hooks" }
81+
pre-commit = { cmd = "lefthook run pre-commit", description = "Run pre-commit checks" }
82+
pylint = { cmd = "pylint array_api_extra", cwd = "src", description = "Lint with pylint" }
83+
mypy = { cmd = "mypy", description = "Type check with mypy" }
84+
pyrefly = { cmd = "pyrefly check", description = "Type check with pyrefly" }
85+
pyright = { cmd = "basedpyright", description = "Type check with basedpyright" }
86+
ruff-check = { cmd = "ruff check --fix", description = "Lint with ruff" }
87+
ruff-format = { cmd = "ruff format", description = "Format with ruff" }
88+
dprint = { cmd = "dprint fmt", description = "Format with dprint" }
89+
typos = { cmd = "typos --write-changes --force-exclude", description = "Fix typos" }
90+
actionlint = { cmd = "actionlint", description = "Lint actions with actionlint" }
91+
zizmor = { cmd = "zizmor .github -p", description = "GHA static analysis with zizmor" }
92+
blacken-docs = { cmd = "blacken-docs", description = "Format Python markdown blocks with Black" }
93+
validate-pyproject = { cmd = "validate-pyproject pyproject.toml", description = "Validate pyproject.toml" }
94+
numpydoc = { cmd = "numpydoc lint", description = "Validate docstrings with numpydoc" }
95+
lint = { cmd = "lefthook run pre-commit --all-files --force", description = "Run all linters" }
96+
97+
[feature.tests.dependencies]
98+
pytest = ">=9.0.3"
99+
pytest-cov = ">=7.1.0"
100+
hypothesis = ">=6.151.9"
101+
array-api-strict = ">=2.5,<2.6"
102+
numpy = ">=1.22.0"
103+
scipy = ">=1.15.2,<2"
104+
105+
[feature.tests.tasks]
106+
tests = { cmd = "pytest -v", description = "Run tests" }
107+
tests-cov = { cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20", description = "Run tests with coverage" }
108+
109+
clean-vendor-compat = { cmd = "rm -rf vendor_tests/array_api_compat", description = "Delete the existing vendored version of array-api-compat" }
110+
clean-vendor-extra = { cmd = "rm -rf vendor_tests/array_api_extra", description = "Delete the existing vendored version of array-api-extra" }
111+
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" }
112+
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" }
113+
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" }
114+
115+
tests-ci = { depends-on = ["tests-cov", "tests-vendor"], description = "Run tests with coverage and vendor tests" }
116+
coverage = { cmd = "coverage html", depends-on = ["tests-cov"], description = "Generate test coverage html report" }
117+
open-coverage = { cmd = "open htmlcov/index.html", depends-on = ["coverage"], description = "Open test coverage report" }
118+
119+
[feature.docs.dependencies]
120+
sphinx = ">=7.4.7"
121+
furo = ">=2025.12.19"
122+
myst-parser = ">=5.0.0"
123+
sphinx-copybutton = ">=0.5.2"
124+
sphinx-autodoc-typehints = ">=1.25.3"
125+
# Needed to import parsed modules with autodoc
126+
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
127+
pytest = ">=9.0.3"
128+
typing-extensions = ">=4.15.0"
129+
numpy = ">=2.1.3"
130+
131+
[feature.docs.tasks]
132+
docs = { cmd = "sphinx-build -E -W . build/", cwd = "docs", description = "Build docs" }
133+
open-docs = { cmd = "open build/index.html", cwd = "docs", depends-on = ["docs"], description = "Open the generated docs" }
134+
135+
[feature.dev.dependencies]
136+
ipython = ">=7.33.0"
137+
138+
[feature.dev.tasks]
139+
ipython = { cmd = "ipython", description = "Launch ipython" }
140+
141+
[feature.py311.dependencies]
142+
python = "~=3.11.0"
143+
144+
[feature.py314.dependencies]
145+
python = "~=3.14.0"
146+
147+
[feature.numpy1.dependencies]
148+
# Oldest NumPy version supported by scikit-learn.
149+
# Note that this is older than what SPEC0 recommends.
150+
numpy = "=1.24.1"
151+
152+
# Backends that can run on CPU-only hosts
153+
# Note: JAX and PyTorch will install CPU variants.
154+
[feature.backends.dependencies]
155+
pytorch = ">=2.10.0"
156+
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
157+
sparse = ">=0.18.0"
158+
159+
[feature.backends.target.linux-64.dependencies]
160+
jax = ">=0.9.2"
161+
162+
[feature.backends.target.osx-64.dependencies]
163+
jax = ">=0.9.2"
164+
165+
[feature.backends.target.osx-arm64.dependencies]
166+
jax = ">=0.9.2"
167+
168+
[feature.backends.target.win-64.dependencies]
169+
# jax = "*" # unavailable
170+
171+
# Backends that require a GPU host and a CUDA driver.
172+
# Note that JAX and PyTorch automatically prefer CUDA variants
173+
# thanks to the `system-requirements` below, *if available*.
174+
# We request them explicitly below to ensure that we don't
175+
# quietly revert to CPU-only in the future, e.g. when CUDA 13
176+
# is released and CUDA 12 builds are dropped upstream.
177+
[feature.cuda-backends]
178+
system-requirements = { cuda = "12" }
179+
180+
[feature.cuda-backends.target.linux.dependencies]
181+
cupy = ">=14.0.1"
182+
jaxlib = { version = ">=0.9.2", build = "cuda12*" }
183+
pytorch = { version = ">=2.10.0", build = "cuda12*" }
184+
185+
[feature.cuda-backends.target.osx.dependencies]
186+
# cupy = "*" # unavailable
187+
# jaxlib = { version = "*", build = "cuda12*" } # unavailable
188+
# pytorch = { version = "*", build = "cuda12*" } # unavailable
189+
190+
[feature.cuda-backends.target.win.dependencies]
191+
cupy = ">=14.0.1"
192+
# jaxlib = { version = "*", build = "cuda12*" } # unavailable
193+
pytorch = { version = ">=2.10.0", build = "cuda12*" }
194+
195+
[feature.nogil.dependencies]
196+
python-freethreading = "~=3.13.0"
197+
pytest-run-parallel = ">=0.8.2"
198+
numpy = ">=2.3.5"
199+
# pytorch = "*" # Not available on Python 3.13t yet
200+
dask-core = ">=2026.3.0" # No distributed, tornado, etc.
201+
# sparse = "*" # numba not available on Python 3.13t yet
202+
# jax = "*" # ml_dtypes not available on Python 3.13t yet

0 commit comments

Comments
 (0)