Skip to content

Commit 7c226c8

Browse files
committed
TST: Update pixi.toml with cupy tests
1 parent 0169ac5 commit 7c226c8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

pixi.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,43 @@ coverage.cmd = [
130130
coverage.depends-on = ["tests-ci"]
131131
coverage.cwd = "."
132132

133+
# CuPy tests
134+
[feature.cupy-tests]
135+
platforms = ["linux-64"]
136+
137+
[feature.cupy-tests.dependencies]
138+
python = ">=3.12.0,<3.13"
139+
pip = "*"
140+
setuptools = "*"
141+
cupy = "*"
142+
pytest = "*"
143+
pytest-forked = "*"
144+
145+
[feature.cupy-tests.tasks]
146+
# Since CuPy tests are only available on Linux, we can use bash like
147+
# this to only clone xsref if it isn't already there and checked out
148+
# at the proper tag.
149+
clone-xsref-test-cupy.cmd = """
150+
bash -c '
151+
if [ -d xsref ]; then
152+
tag=$(git -C xsref describe --tags --exact-match 2>/dev/null || true)
153+
fi
154+
if [ \"$tag\" != v0.0.0 ]; then
155+
rm -rf xsref
156+
git clone --branch v0.0.0 --depth 1 https://github.com/scipy/xsref.git
157+
fi
158+
'
159+
"""
160+
clone-xsref-test-cupy.cwd = "."
161+
install-xsref-test-cupy.cmd = "pip install ."
162+
install-xsref-test-cupy.cwd = "xsref"
163+
install-xsref-test-cupy.depends-on = ["clone-xsref-test-cupy"]
164+
test-cupy.cmd = "pytest --forked python_tests/test_cupy.py"
165+
test-cupy.cwd = "."
166+
test-cupy.depends-on = ["install-xsref-test-cupy"]
133167

134168
[environments]
135169
default = { features = ["build", "tests"], solve-group = "default" }
136170
tests-ci = { features = ["build", "tests", "tests-ci", "coverage"], solve-group = "default" }
137171
lint = { features = ["clang-format"], solve-group = "default" }
172+
cupy-tests = { features = ["cupy-tests"], solve-group = "default" }

0 commit comments

Comments
 (0)