Skip to content

Commit 094804b

Browse files
committed
Add pixi config for running notebooks
Defines a default pixi environment with jupyterlab + ipykernel + nbconvert + watermark from conda-forge and spatialdata-plot + squidpy from PyPI. Tasks: `kernel-install` registers a Jupyter kernel named "sdata-plot-notebooks" pointing at the pixi env's Python; `lab` opens JupyterLab; `execute` re-runs every notebook in place. The existing `[exec]` pip extra is retained for users who prefer plain venv-based setups.
1 parent 25cb8e1 commit 094804b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ Documentation = "https://spatialdata.scverse.org/projects/plot/en/latest/"
3535
[tool.hatch.build.targets.wheel]
3636
bypass-selection = true
3737

38+
# Pixi-managed environment for running and authoring the notebooks. After
39+
# `pixi install`, register the Jupyter kernel once with `pixi run
40+
# kernel-install`; the kernel will point at the pixi env's Python, so
41+
# `pixi run lab` (or any external Jupyter) can execute the notebooks
42+
# against the exact pinned dependencies.
43+
[tool.pixi]
44+
workspace.channels = ["conda-forge"]
45+
workspace.platforms = ["linux-64", "osx-arm64"]
46+
47+
dependencies.python = ">=3.11"
48+
dependencies.jupyterlab = "*"
49+
dependencies.ipykernel = "*"
50+
dependencies.nbconvert = "*"
51+
dependencies.watermark = "*"
52+
53+
pypi-dependencies.spatialdata-plot = ">=0.3"
54+
pypi-dependencies.squidpy = "*"
55+
56+
tasks.kernel-install = 'python -m ipykernel install --user --name sdata-plot-notebooks --display-name "sdata-plot-notebooks"'
57+
tasks.lab = "jupyter lab"
58+
tasks.execute = "jupyter nbconvert --to notebook --execute --inplace tutorials/*.ipynb examples/*.ipynb"
59+
3860
[tool.ruff]
3961
line-length = 120
4062
target-version = "py311"

0 commit comments

Comments
 (0)