-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathpixi.toml
More file actions
215 lines (187 loc) · 5.72 KB
/
pixi.toml
File metadata and controls
215 lines (187 loc) · 5.72 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
[workspace]
authors = [
"Albert Steppi <albert.steppi@gmail.com>",
"Irwin Zaid <irwin.zaid@gmail.com>",
]
channels = ["https://prefix.dev/conda-forge"]
description = "Special function implementations."
name = "xsf"
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
version = "0.2.2"
## Build
[feature.build.dependencies]
cmake = ">=3.30.5,<4"
cxx-compiler = ">=1.8.0,<2"
make = ">=4.4.1,<5"
[feature.build.tasks.configure]
cmd = [
"cmake",
# The source is in the root directory
"-S .",
# We want to build in the build directory
"-B build",
]
cwd = "."
[feature.build.tasks.build-only]
# Just build without configure
cmd = ["cmake", "--build", "build", "--config", "Release"]
cwd = "."
[feature.build.tasks.build]
# Build with default configuration
depends-on = ["configure", "build-only"]
## Tests
[feature.tests.dependencies]
catch2 = ">=3.8.0,<4"
libarrow-all = ">=19.0.1,<20"
[feature.tests.tasks]
# clean xsref dir
clean-xsref = { cwd = ".", cmd = "rm -rf xsref" }
# clone xsref
clone-xsref.cmd = "git clone --depth 1 --branch v0.0.0 https://github.com/scipy/xsref.git"
clone-xsref.cwd = "."
clone-xsref.depends-on = ["clean-xsref"]
# configure cmake for tests
configure-tests.cmd = [
"cmake",
# Enable building tests
"-DBUILD_TESTS=ON",
# The source is in the root directory
"-S .",
# We want to build in the build directory
"-B build",
]
configure-tests.cwd = "."
# build for tests
build-tests.depends-on = ["configure-tests", "build-only"]
# run tests
tests.cmd = ["ctest", "--output-on-failure", "--test-dir", "build/tests"]
tests.depends-on = ["clone-xsref", "build-tests"]
tests.cwd = "."
## Tests of debug build (catches asserts that can cause program to abort)
[feature.tests-debug.tasks]
configure-tests-debug.cmd = [
"cmake",
# Enable building tests
"-DBUILD_TESTS=ON",
# set as debug build
"-DCMAKE_BUILD_TYPE=Debug",
# The source is in the root directory
"-S .",
# use build-debug directory to avoid overwriting build directory.
"-B build-debug",
]
configure-tests-debug.cwd = "."
build-tests-debug.cmd = ["cmake", "--build", "build-debug", "--config", "Debug"]
build-tests-debug.depends-on = ["configure-tests-debug"]
build-tests-debug.cwd = "."
tests-debug.cmd = ["ctest", "--output-on-failure", "--test-dir", "build-debug/tests"]
tests-debug.depends-on = ["clone-xsref", "build-tests-debug"]
tests-debug.cwd = "."
## clang-format
[feature.clang-format.dependencies]
git = "*"
clang-format = "*"
[feature.clang-format.tasks]
format = "git ls-files '*.cpp' '*.h' | xargs clang-format -i --style=file"
format-dry-error = "git ls-files '*.cpp' '*.h' | xargs clang-format --style=file --Werror --dry-run"
## Coverage
[feature.coverage.dependencies]
lcov = ">=1.16,<2"
[feature.coverage.tasks]
# Configure with tests and coverage
configure-coverage.cmd = [
"cmake",
# Enable building tests
"-DBUILD_TESTS=ON",
# Enable Coverage
"-DCMAKE_BUILD_TYPE=Coverage",
# The source is in the root directory
"-S .",
# We want to build in the build directory
"-B build",
]
configure-coverage.cwd = "."
configure-coverage.env.XSREF_TABLES_PATH = "$PWD/xsref/tables"
configure-coverage.env.CC = "ccache $CC"
configure-coverage.env.CXX = "ccache $CXX"
# Open coverage report
open-coverage.cmd = ["open", "index.html"]
open-coverage.cwd = "build/coverage_report"
## Tests CI
[feature.tests-ci.dependencies]
ccache = ">=4.11.2,<5"
[feature.tests-ci.tasks]
# Build and generate coverage report
# TODO: use a task arg for parallelism https://github.com/prefix-dev/pixi/pull/3433
build-tests-ci.cmd = ["cmake", "--build", "build", "-j3", "--config", "Release"]
build-tests-ci.depends-on = ["clone-xsref", "configure-coverage"]
build-tests-ci.cwd = "."
# Run tests
tests-ci.cmd = ["ctest", "--output-on-failure", "--test-dir", "build/tests", "-j3"]
tests-ci.depends-on = ["build-tests-ci"]
tests-ci.cwd = "."
# Coverage
coverage.cmd = [
"cmake",
"--build",
"build",
"--target",
"coverage_html",
"-j3",
"--config",
"Release",
]
coverage.depends-on = ["tests-ci"]
coverage.cwd = "."
[feature.tests-debug-ci.tasks]
build-tests-debug-ci.cmd = ["cmake", "--build", "build-debug", "-j3", "--config", "Debug"]
build-tests-debug-ci.depends-on = ["clone-xsref", "configure-tests-debug"]
build-tests-debug-ci.cwd = "."
tests-debug-ci.cmd = [
"ctest",
"--output-on-failure",
"--test-dir",
"build-debug/tests",
"-j3",
"--build-config",
"Debug",
]
tests-debug-ci.depends-on = ["clone-xsref", "build-tests-debug-ci"]
tests-debug-ci.cwd = "."
# CuPy tests
[feature.cupy-tests]
platforms = ["linux-64"]
[feature.cupy-tests.dependencies]
python = ">=3.12.0,<3.13"
pip = "*"
setuptools = "*"
cupy = "*"
pytest = "*"
pytest-forked = "*"
[feature.cupy-tests.tasks]
# Since CuPy tests are only available on Linux, we can use bash like
# this to only clone xsref if it isn't already there and checked out
# at the proper tag.
clone-xsref-test-cupy.cmd = """
bash -c '
if [ -d xsref ]; then
tag=$(git -C xsref describe --tags --exact-match 2>/dev/null || true)
fi
if [ \"$tag\" != v0.0.0 ]; then
rm -rf xsref
git clone --branch v0.0.0 --depth 1 https://github.com/scipy/xsref.git
fi
'
"""
clone-xsref-test-cupy.cwd = "."
install-xsref-test-cupy.cmd = "pip install ."
install-xsref-test-cupy.cwd = "xsref"
install-xsref-test-cupy.depends-on = ["clone-xsref-test-cupy"]
test-cupy.cmd = "pytest --forked python_tests/test_cupy.py"
test-cupy.cwd = "."
test-cupy.depends-on = ["install-xsref-test-cupy"]
[environments]
default = { features = ["build", "tests", "tests-debug"], solve-group = "default" }
tests-ci = { features = ["build", "tests", "tests-ci", "tests-debug", "tests-debug-ci", "coverage"], solve-group = "default"}
lint = { features = ["clang-format"], solve-group = "default" }
cupy-tests = { features = ["cupy-tests"], solve-group = "default" }