Skip to content

Commit e561396

Browse files
DOC: Add descriptions for pixi tasks (#11155)
* MAINT: Add descriptions for pixi tasks * DOC: Update contributing instructions `pixi list` was incorrect. Also remove examples as `pixi task list` how does this. * Rename Pixi task check-policy-> _check-policy
1 parent 65c5df3 commit e561396

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

doc/contribute/contributing.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ development environment:
208208

209209
That's it! Now you're ready to contribute to Xarray.
210210

211-
Pixi defines multiple environments as well as tasks to help you with development. These include tasks for:
211+
Pixi defines multiple environments as well as tasks to help you with development (view these by running ``pixi task list``). These include tasks for:
212212

213213
- running the test suite
214214
- building the documentation
@@ -221,16 +221,10 @@ are only run in a single environment (e.g., building the documentation or runnin
221221

222222
You can see all available environments and tasks by running::
223223

224-
pixi list
224+
pixi info
225225

226-
For example:
227226

228-
- ``pixi run doc`` will build the documentation
229-
- ``pixi run mypy`` will run the static type checker
230-
- ``pixi run test`` will run the test suite
231-
- ``pixi run pre-commit`` will run all code formatters and linters - defined via the pre-commit hooks
232-
233-
When running ``pixi run test`` you will be prompted to select which environment you want to use. You can specify the environment
227+
When running a test you may be prompted to select which environment you want to use. You can specify the environment
234228
directly by providing the ``-e`` flag, e.g., ``pixi run -e my_environment test`` . Our CI setup uses Pixi as well - you can easily
235229
reproduce CI tests by running the same tasks in the same environments as defined in the CI.
236230

pixi.toml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ hypothesis = "*"
212212
coveralls = "*"
213213

214214
[feature.test.tasks]
215-
test = { cmd = "pytest" }
215+
test = { cmd = "pytest", description = "Run the test suite with pytest." }
216216

217217
[feature.doc.dependencies]
218218
kerchunk = "*"
@@ -241,8 +241,8 @@ sphinxext-rediraffe = "*"
241241
cfgrib = "*"
242242

243243
[feature.doc.tasks]
244-
doc = { cmd = "make html", cwd = "doc" }
245-
doc-clean = { cmd = "make clean && make html", cwd = "doc" }
244+
doc = { cmd = "make html", cwd = "doc", description = "Build the HTML documentation." }
245+
doc-clean = { cmd = "make clean && make html", cwd = "doc", description = "Clean build artifacts and rebuild the HTML documentation from scratch." }
246246
linkcheck = { cmd = "make linkcheck", cwd = "doc", description = "Check URLs in documentation." }
247247

248248

@@ -270,20 +270,20 @@ types-defusedxml = "*"
270270
types-pexpect = "*"
271271

272272
[feature.typing.tasks]
273-
mypy = "mypy --install-types --non-interactive --cobertura-xml-report mypy_report"
273+
mypy = { cmd = "mypy --install-types --non-interactive --cobertura-xml-report mypy_report", description = "Run mypy type checking and generate a Cobertura XML report." }
274274

275275
[feature.pre-commit.dependencies]
276276
pre-commit = "*"
277277

278278
[feature.pre-commit.tasks]
279-
pre-commit = { cmd = "pre-commit" }
279+
pre-commit = { cmd = "pre-commit", description = "Run pre-commit hooks and linters." }
280280

281281
[feature.release.dependencies]
282282
gitpython = "*"
283283
cytoolz = "*"
284284

285285
[feature.release.tasks]
286-
release-contributors = "python ci/release_contributors.py"
286+
release-contributors = { cmd = "python ci/release_contributors.py", description = "Generate a list of contributors for a release." }
287287

288288
[feature.dev.dependencies]
289289
ipython = ">=9.8.0,<10"
@@ -298,35 +298,38 @@ xarray-minimum-dependency-policy = "*"
298298
[feature.policy.dependencies]
299299
python = "3.13.*"
300300

301-
[feature.policy.tasks.check-policy]
301+
[feature.policy.tasks._check-policy]
302302
cmd = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml {{ env }}"
303303
args = ["env"]
304304

305305
[feature.policy.tasks]
306306
policy-bare-minimum = [
307-
{ task = "check-policy", args = [
307+
{ task = "_check-policy", args = [
308308
"pixi:test-py311-bare-minimum",
309309
] },
310310
]
311311
policy-bare-min-and-scipy = [
312-
{ task = "check-policy", args = [
312+
{ task = "_check-policy", args = [
313313
"pixi:test-py311-bare-min-and-scipy",
314314
] },
315315
]
316316
policy-min-versions = [
317-
{ task = "check-policy", args = [
317+
{ task = "_check-policy", args = [
318318
"pixi:test-py311-min-versions",
319319
] },
320320
]
321-
policy = [
322-
{ task = "check-policy", args = [
321+
[feature.policy.tasks.policy]
322+
323+
depends-on = [
324+
{ task = "_check-policy", args = [
323325
"""\
324326
pixi:test-py311-bare-minimum \
325327
pixi:test-py311-bare-min-and-scipy \
326328
pixi:test-py311-min-versions \
327329
""",
328330
] },
329331
]
332+
description = "Check all minimum version test environments match Xarray's version policy."
330333

331334
[environments]
332335
# Testing

0 commit comments

Comments
 (0)