Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pixi run test # should pass (tests your package imports correct
pixi run lab # opens Jupyter Lab
```

In Jupyter Lab, check that your kernel appears (look for `{{ cookiecutter.project_name }} (pixi)`).
In Jupyter Lab, check that your kernel appears (look for `{{ cookiecutter.project_name }} (pixi, default)`).

🎉 **You're ready to start analyzing!**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "{{ cookiecutter.project_name }} (pixi)",
"display_name": "{{ cookiecutter.project_name }} (pixi, default)",
"language": "python",
"name": "{{ cookiecutter.project_name }}"
"name": "{{ cookiecutter.project_name }}-default"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ platforms = ["osx-arm64", "linux-64"]
[tasks]
lab = "jupyter lab"
test = "pytest"
install-kernel = "python -m ipykernel install --user --name={{ cookiecutter.project_name }} --display-name='{{ cookiecutter.project_name }} (pixi)'"
install-kernel = 'python -m ipykernel install --user --name={{ cookiecutter.project_name }}-$PIXI_ENVIRONMENT_NAME --display-name="{{ cookiecutter.project_name }} (pixi, $PIXI_ENVIRONMENT_NAME)"'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve compatibility for project-owned notebook kernels

For existing projects that apply this through cruft update, only pixi.toml receives the renamed kernel because pyproject.toml:91-93 explicitly excludes README.md and analysis/ from updates. On a fresh machine, install-kernel therefore registers <project>-default while every existing project-owned notebook still requests <project>, leaving Jupyter unable to resolve its kernelspec without manual reselection. Preserve the old default-environment alias or provide a migration that can update those skipped notebooks.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not fixing. On machines that already have the old kernel it stays registered, so existing notebooks keep working there. On a fresh machine, Jupyter asks once per notebook to pick a kernel, and the notebook then stores the new name. Keeping the old name for the default environment would need per-environment activation variables, because pixi's task shell has no conditionals. That's more config in every project than a one-time kernel pick is worth.

install-hooks = { cmd = "pre-commit install --install-hooks", description = "Install pre-commit hooks (run once per clone)" }

[dependencies]
Expand Down
Loading