Skip to content

Commit 83252a6

Browse files
Merge pull request #42 from renan-r-santos/multiple-envs
Add support for Pixi environments
2 parents 15e1334 + 4044018 commit 83252a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7084
-534
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
pixi-version: ["0.30.0", "0.39.3"]
15+
pixi-version: ["0.30.0", "0.39.4"]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Checkout repo

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ dist
2626

2727
# System
2828
.DS_Store
29+
30+
# Frontend
31+
lib
32+
node_modules
33+
.yarn
34+
tsconfig.tsbuildinfo
35+
.eslintcache
36+
pixi_kernel/labextension

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
lib
3+
pixi_kernel
4+
kernels

.prettierrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid",
5+
"endOfLine": "auto",
6+
"overrides": [
7+
{
8+
"files": "package.json",
9+
"options": {
10+
"tabWidth": 4
11+
}
12+
}
13+
]
14+
}

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "JupyterLab",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${workspaceFolder}/.venv/bin/jupyter-lab",
12+
"console": "integratedTerminal",
13+
"args": [
14+
"-y",
15+
"--no-browser",
16+
"--ContentsManager.allow_hidden=True",
17+
"--notebook-dir",
18+
"../notebooks"
19+
],
20+
"justMyCode": false
21+
}
22+
]
23+
}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"[python]": {
33
"editor.codeActionsOnSave": {
4-
"source.organizeImports": "always"
4+
"source.organizeImports": "always"
55
},
66
"editor.defaultFormatter": "charliermarsh.ruff"
77
},
88
"editor.formatOnSave": true,
99
"editor.rulers": [99],
1010
"python.testing.pytestArgs": ["tests/unit"],
11-
"python.testing.pytestEnabled": true,
11+
"python.testing.pytestEnabled": true
1212

1313
// Uncomment the following lines to enable unittest.
1414
// Apparently VSCode cant' handle unittest and pytest at the same time.

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CONTRIBUTING.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Pixi Kernel is free and open source software developed under an MIT license. Development occurs at
3+
Pixi kernel is free and open source software developed under an MIT license. Development occurs at
44
the [GitHub project](https://github.com/renan-r-santos/pixi-kernel). Contributions are welcome.
55

66
Bug reports and feature requests may be made directly on the
@@ -11,23 +11,29 @@ tests, push the changes, and [open a PR](https://github.com/renan-r-santos/pixi-
1111

1212
## Cloning the repo
1313

14-
To make a local copy of Pixi Kernel, clone the repository with git:
14+
To make a local copy of Pixi kernel, clone the repository with git:
1515

1616
```
1717
git clone https://github.com/renan-r-santos/pixi-kernel.git
1818
```
1919

2020
## Installing system dependencies
2121

22-
Pixi Kernel uses `uv` as its packaging and dependency manager. Follow the
22+
Pixi kernel uses `uv` as its packaging and dependency manager. Follow the
2323
[official docs](https://docs.astral.sh/uv) for installing `uv`.
2424

25-
Additionally, Pixi Kernel needs `pixi` to run tests. Follow the [official docs](https://pixi.sh)
25+
Additionally, Pixi kernel needs `pixi` to run tests. Follow the [official docs](https://pixi.sh)
2626
for installing `pixi`.
2727

28+
Install the project dependencies with:
29+
30+
```
31+
uv sync
32+
```
33+
2834
## Testing and code quality
2935

30-
Pixi Kernel uses `pytest`, `unittest` and `tox` to run the tests in the `tests/` directory.
36+
Pixi kernel uses `pytest`, `unittest` and `tox` to run the tests in the `tests/` directory.
3137
To run all of them, use:
3238

3339
```
@@ -43,7 +49,7 @@ uv run tox run -e py313-test
4349

4450
## Code quality
4551

46-
Pixi Kernel uses Ruff and MyPy to ensure a minimum standard of code quality. The code quality
52+
Pixi kernel uses Ruff and MyPy to ensure a minimum standard of code quality. The code quality
4753
commands are encapsulated with `uv` and `tox`:
4854

4955
```
@@ -55,7 +61,7 @@ uv run tox run -e type_check
5561
## Making a release
5662

5763
1. Bump
58-
1. Increment version in `pyproject.toml`
64+
1. Increment version in `pyproject.toml` and `package.json`
5965
2. Update all lock files by running `uv sync -U` and `pixi update`
6066
3. Commit with message "chore: Bump version number to X.Y.Z"
6167
4. Push commit to GitHub
@@ -69,4 +75,4 @@ uv run tox run -e type_check
6975
4. Check [PyPI](https://pypi.org/project/pixi-kernel/) for good upload
7076
3. Document
7177
1. Create [GitHub release](https://github.com/renan-r-santos/pixi-kernel/releases) with name
72-
"Pixi Kernel X.Y.Z" and major changes in body
78+
"Pixi kernel X.Y.Z" and major changes in body

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pixi Kernel
1+
# Pixi kernel
22

33
[![image](https://img.shields.io/pypi/v/pixi-kernel)](https://pypi.python.org/pypi/pixi-kernel)
44
[![image](https://img.shields.io/pypi/l/pixi-kernel)](https://pypi.python.org/pypi/pixi-kernel)
@@ -12,9 +12,10 @@ Per-directory Pixi environments with multi-language Jupyter kernels.
1212

1313
<!--- TODO: add theme selector when supported on PyPI https://github.com/pypi/warehouse/issues/11251 -->
1414

15-
![JupyterLab launcher screen showing Pixi Kernel](https://raw.githubusercontent.com/renan-r-santos/pixi-kernel/main/assets/launch-light.png)
15+
![JupyterLab launcher screen showing Pixi kernel](https://raw.githubusercontent.com/renan-r-santos/pixi-kernel/main/assets/launch-light.png)
1616

17-
Pixi Kernel supports Python 3.9+ and Pixi 0.30.0+ using `pyproject.toml` and `pixi.toml` configurations.
17+
Pixi kernel supports Jupyterlab 4, Python 3.9+ and Pixi 0.30.0+ using `pyproject.toml` and
18+
`pixi.toml` configurations.
1819

1920
**Disclaimer**: _This project is not affiliated with Pixi, and not an official Pixi plugin._
2021

@@ -32,7 +33,7 @@ See the [Pixi docs](https://pixi.sh/latest/) for more information on how to use
3233

3334
## Kernel support
3435

35-
Pixi Kernel supports the following kernels:
36+
Pixi kernel supports the following kernels:
3637

3738
| Language | Kernel | Package name |
3839
| -------- | -------------- | -------------------------------------------------- |
@@ -42,11 +43,16 @@ Pixi Kernel supports the following kernels:
4243
Support for other kernels and languages can be added by opening an issue or a pull request, see
4344
[CONTRIBUTING](CONTRIBUTING.md#adding-support-for-new-kernels).
4445

46+
## Pixi environments
47+
48+
Pixi kernel supports multiple Pixi environments in a single Pixi project. To select a specific
49+
environment, use JupyterLab property inspector, save your notebook and restart your kernel.
50+
51+
![JupyterLab property inspector showing Pixi environment selector](https://raw.githubusercontent.com/renan-r-santos/pixi-kernel/main/assets/env-selector-light.png)
52+
4553
## Limitations
4654

47-
Pixi Kernel only works with the default environment. If you have an idea how to support multiple
48-
environments see [this issue](https://github.com/renan-r-santos/pixi-kernel/issues/20) or see
49-
[CONTRIBUTING](CONTRIBUTING.md#adding-support-for-new-kernels).
55+
Pixi kernel only works with the default environment in VSCode.
5056

5157
## Related
5258

assets/env-selector-dark.png

37.9 KB
Loading

0 commit comments

Comments
 (0)