Skip to content

Commit 1bd4ecc

Browse files
committed
doc: Add pixi task descriptions
1 parent 8d42f5b commit 1bd4ecc

4 files changed

Lines changed: 87 additions & 27 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ We use the [Pixi](https://prefix.dev/) Conda-compatible environment manager for
5252
With this single tool, we can get most dependencies, including NodeJS and Python themselves.
5353
Head to their site for installation instructions.
5454

55+
Run `pixi task list` for details on all available tasks.
56+
5557
Only the javascript packages need to be installed.
5658
This is managed by the `jlpm` command, JupyterLab's pinned version of [yarn](https://yarnpkg.com/)
5759
that is installed with JupyterLab in the Pixi file.
@@ -117,6 +119,21 @@ extension in JupyterLab.
117119

118120
More information are provided within the [ui-tests](./ui-tests/README.md) README.
119121

122+
### Running code formatters and checks
123+
124+
To run all code formatters, use Pixi:
125+
126+
```sh
127+
pixi run fmt
128+
```
129+
130+
Similarly for the code checks:
131+
132+
```sh
133+
pixi run check
134+
```
135+
136+
120137
### Packaging the extension
121138

122139
See [RELEASE](RELEASE.md)

‎biome.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"!.pixi/**/*",
88
"!.vscode/**/*",
99
"!lib/**/*",
10-
"!arbalister/labextension/**/*"
10+
"!arbalister/labextension/**/*",
11+
"!coverage/**/*"
1112
]
1213
},
1314
"assist": {

‎pixi.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -132,35 +132,79 @@ taplo = ">=0.9.2"
132132
typos = ">=1.31.2"
133133
faker = "*"
134134

135-
[tool.pixi.feature.test.tasks]
136135
# Formatters
137-
fmt-ruff = "ruff format"
138-
fmt-biome = "biome format --write"
139-
fmt-taplo = "taplo format pyproject.toml"
140-
fmt = [{ task = "fmt-ruff" }, { task = "fmt-biome" }, { task = "fmt-taplo" }]
136+
137+
[tool.pixi.feature.test.tasks.fmt-ruff]
138+
cmd = "ruff format"
139+
description = "Format Python files with ruff."
140+
141+
[tool.pixi.feature.test.tasks.fmt-biome]
142+
cmd = "biome format --write"
143+
description = "Format JS/TS files with biome."
144+
145+
[tool.pixi.feature.test.tasks.fmt-taplo]
146+
cmd = "taplo format pyproject.toml"
147+
description = "Format TOML files with taplo."
148+
149+
[tool.pixi.feature.test.tasks.fmt]
150+
depends-on = [
151+
{ task = "fmt-ruff" },
152+
{ task = "fmt-biome" },
153+
{ task = "fmt-taplo" },
154+
]
155+
description = "Run all code formatters."
156+
141157
# Checkers
142-
check-ruff = "ruff check --extend-exclude '*/jupyter_server_test_config.py' --fix --unsafe-fixes"
143-
check-ruff-format = "ruff format --check"
144-
check-mypy = "python -m mypy arbalister/ data/"
145-
check-biome = "biome check --write --error-on-warnings"
146-
check-taplo-format = "taplo check"
147-
check-typos = "typos --write-changes"
148-
check = [
149-
{ task = "check-ruff-format" },
158+
159+
[tool.pixi.feature.test.tasks.check-ruff]
160+
cmd = "ruff check --extend-exclude '*/jupyter_server_test_config.py' --fix --unsafe-fixes"
161+
description = "Check Python code with ruff."
162+
163+
[tool.pixi.feature.test.tasks.check-mypy]
164+
cmd = "python -m mypy arbalister/ data/"
165+
description = "Check Python typing with MyPy."
166+
167+
[tool.pixi.feature.test.tasks.check-biome]
168+
cmd = "biome check --write --error-on-warnings"
169+
description = "Check JS/TS code with biome."
170+
171+
[tool.pixi.feature.test.tasks.check-typos]
172+
cmd = "typos --write-changes"
173+
description = "Check for English typos with typos."
174+
175+
[tool.pixi.feature.test.tasks.check]
176+
depends-on = [
150177
{ task = "check-ruff" },
151178
{ task = "check-mypy" },
152179
{ task = "check-biome" },
153-
{ task = "check-taplo-format" },
154180
{ task = "check-typos" },
155181
]
182+
description = "Run all code checks."
183+
156184
# Tests
157-
test-pytest = "python -m pytest"
158-
test-jest = "npx --no jest --coverage"
159-
test = { depends-on = ["test-pytest", "test-jest"] }
185+
186+
[tool.pixi.feature.test.tasks.test-pytest]
187+
cmd = "python -m pytest"
188+
description = "Test server extension with pytest."
189+
190+
[tool.pixi.feature.test.tasks.test-jest]
191+
cmd = "npx --no jest --coverage"
192+
description = "Test client extension with Jest."
193+
194+
[tool.pixi.feature.test.tasks.test]
195+
depends-on = ["test-pytest", "test-jest"]
196+
description = "Run all tests."
197+
160198
# All
161-
ci = { depends-on = ["check", "test"] }
162199

163-
[tool.pixi.feature.test.tasks.gen-data]
200+
[tool.pixi.feature.test.tasks.ci]
201+
depends-on = ["check", "test"]
202+
description = "Run all formatters, code checks, and tests."
203+
204+
[tool.pixi.feature.dev.activation.env]
205+
JUPYTERLAB_PATH = "$PIXI_PROJECT_ROOT/arbalister/labextension"
206+
207+
[tool.pixi.feature.dev.tasks.gen-data]
164208
cmd = """
165209
python data/generate.py batch \
166210
--num-rows 1_000_000 \
@@ -170,9 +214,7 @@ python data/generate.py batch \
170214
-o data/gen/test.ipc \
171215
"""
172216
outputs = ["data/gen/**/*"]
173-
174-
[tool.pixi.feature.dev.activation.env]
175-
JUPYTERLAB_PATH = "$PIXI_PROJECT_ROOT/arbalister/labextension"
217+
description = """Generate different data files to use in development in data/gen."""
176218

177219
[tool.pixi.feature.dev.dependencies]
178220
jupyterlab = ">=4.4"
@@ -185,9 +227,9 @@ typescript-language-server = ">=5.1"
185227
typos-lsp = "*"
186228

187229
[tool.pixi.feature.dev.tasks]
188-
jlpm = "jlpm"
230+
jlpm = { cmd = "jlpm", description = "Run Jupyter lab package manager." }
189231
jlpm-build = "jlpm run build"
190232
jlpm-watch = "jlpm run watch"
191-
pre-commit = "pre-commit"
233+
pre-commit = { cmd = "pre-commit", description = "Run pre-commit executable." }
234+
jupyter = { cmd = "jupyter", description = "Run jupyter." }
192235
labextension = "jupyter labextension"
193-
jupyter = "jupyter"

0 commit comments

Comments
 (0)