|
1 | 1 | # jupyterlite-xeus-python
|
2 | 2 |
|
3 |
| -> [!WARNING] |
4 |
| -> jupyterlite-xeus-python is DEPRECATED |
5 |
| -> See [the migration guide](https://xeus-python-kernel.readthedocs.io/en/latest/migration.html) |
6 |
| -
|
7 |
| -[![ci-badge]][ci] [![docs-badge]][docs] |
8 |
| - |
9 |
| -[ci-badge]: https://github.com/jupyterlite/xeus-python-kernel/workflows/Build/badge.svg |
10 |
| -[ci]: https://github.com/jupyterlite/xeus-python-kernel/actions?query=branch%3Amain |
11 |
| -[docs-badge]: https://readthedocs.org/projects/xeus-python-kernel/badge/?version=latest |
12 |
| -[docs]: https://xeus-python-kernel.readthedocs.io/en/latest/?badge=latest |
13 |
| - |
14 |
| -The [xeus-python](https://github.com/jupyter-xeus/xeus-python) Python kernel for JupyterLite running in the browser. |
15 |
| - |
16 |
| - |
17 |
| - |
18 |
| -## Install |
19 |
| - |
20 |
| -You can install the kernel with conda/mamba: |
21 |
| - |
22 |
| -```bash |
23 |
| -mamba install -c conda-forge jupyterlite-xeus-python |
24 |
| -``` |
25 |
| - |
26 |
| -Or using pip: |
27 |
| - |
28 |
| -```bash |
29 |
| -pip install jupyterlite-xeus-python |
30 |
| -``` |
31 |
| - |
32 |
| -Then build your JupyterLite site: |
33 |
| - |
34 |
| -```bash |
35 |
| -jupyter lite build |
36 |
| -``` |
37 |
| - |
38 |
| -## Pre-installed packages |
39 |
| - |
40 |
| -xeus-python allows you to pre-install packages in the Python runtime. You can pre-install packages by adding an `environment.yml` file in the JupyterLite build directory, this file will be found automatically by xeus-python which will pre-build the environment when running `jupyter lite build`. |
41 |
| - |
42 |
| -Furthermore, this automatically installs any labextension that it founds, for example installing ipyleaflet will make ipyleaflet work without the need to manually install the jupyter-leaflet labextension. |
43 |
| - |
44 |
| -Say you want to install `NumPy`, `Matplotlib` and `ipycanvas`, it can be done by creating the `environment.yml` file with the following content: |
45 |
| - |
46 |
| -```yml |
47 |
| -name: xeus-python-kernel |
48 |
| -channels: |
49 |
| - - https://repo.mamba.pm/emscripten-forge |
50 |
| - - conda-forge |
51 |
| -dependencies: |
52 |
| - - numpy |
53 |
| - - matplotlib |
54 |
| - - ipycanvas |
55 |
| -``` |
56 |
| -
|
57 |
| -Then you only need to build JupyterLite: |
58 |
| -
|
59 |
| -```bash |
60 |
| -jupyter lite build |
61 |
| -``` |
62 |
| - |
63 |
| -You can also pick another name for that environment file (_e.g._ `custom.yml`), by doing so, you will need to specify that name to xeus-python: |
64 |
| - |
65 |
| -```bash |
66 |
| -jupyter lite build --XeusPythonEnv.environment_file=custom.yml |
67 |
| -``` |
68 |
| - |
69 |
| -## Contributing |
70 |
| - |
71 |
| -### Development install |
72 |
| - |
73 |
| -Note: You will need NodeJS to build the extension package. |
74 |
| - |
75 |
| -The `jlpm` command is JupyterLab's pinned version of |
76 |
| -[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use |
77 |
| -`yarn` or `npm` in lieu of `jlpm` below. |
78 |
| - |
79 |
| -```bash |
80 |
| -# Clone the repo to your local environment |
81 |
| -# Change directory to the jupyterlite-xeus-python directory |
82 |
| -# Install package in development mode |
83 |
| -python -m pip install -e ".[dev]" |
84 |
| - |
85 |
| -# Link your development version of the extension with JupyterLab |
86 |
| -jupyter labextension develop . --overwrite |
87 |
| - |
88 |
| -# Rebuild extension Typescript source after making changes |
89 |
| -jlpm run build |
90 |
| -``` |
91 |
| - |
92 |
| -You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. |
93 |
| - |
94 |
| -```bash |
95 |
| -# Watch the source directory in one terminal, automatically rebuilding when needed |
96 |
| -jlpm run watch |
97 |
| -# Run JupyterLab in another terminal |
98 |
| -jupyter lab |
99 |
| -``` |
100 |
| - |
101 |
| -With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). |
102 |
| - |
103 |
| -### Development uninstall |
104 |
| - |
105 |
| -```bash |
106 |
| -pip uninstall jupyterlite-xeus-python |
107 |
| -``` |
108 |
| - |
109 |
| -In development mode, you will also need to remove the symlink created by `jupyter labextension develop` |
110 |
| -command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions` |
111 |
| -folder is located. Then you can remove the symlink named `jupyterlite-xeus-python` within that folder. |
112 |
| - |
113 |
| -### Packaging the extension |
114 |
| - |
115 |
| -See [RELEASE](RELEASE.md) |
| 3 | +> ⚠️ |
| 4 | +> jupyterlite-xeus-python is DEPRECATED. |
| 5 | +> Please use https://github.com/jupyterlite/xeus. |
| 6 | +> See [the migration guide](https://xeus-python-kernel.readthedocs.io/en/latest/migration.html). |
0 commit comments