You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 14, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+25-11Lines changed: 25 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,25 +31,39 @@ jupyter lite build
31
31
32
32
## Pre-installed packages
33
33
34
-
xeus-python allows you to pre-install packages in the Python runtime. You can pre-install packages by passing the `XeusPythonEnv.packages` CLI option to `jupyter lite build`.
35
-
This will automatically install any labextension that it founds, for example installing ipyleaflet will make ipyleaflet work without the need to manually install the jupyter-leaflet labextension.
34
+
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`.
36
35
37
-
For example, say you want to install `NumPy`, `Matplotlib` and `ipyleaflet`, it can be done with the following command:
36
+
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.
37
+
38
+
Say you want to install `NumPy`, `Matplotlib` and `ipyleaflet`, it can be done by creating the `environment.yml` file with the following content:
39
+
40
+
```yml
41
+
name: xeus-python-kernel
42
+
channels:
43
+
- https://repo.mamba.pm/emscripten-forge
44
+
- https://repo.mamba.pm/conda-forge
45
+
dependencies:
46
+
- numpy
47
+
- matplotlib
48
+
- ipycanvas
49
+
```
50
+
51
+
Then you only need to build JupyterLite:
38
52
39
53
```bash
40
-
jupyter lite build --XeusPythonEnv.packages=numpy,matplotlib,ipyleaflet
54
+
jupyter lite build
41
55
```
42
56
43
-
The same can be achieved through a `jupyterlite_config.json` file:
57
+
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:
44
58
45
-
```json
46
-
{
47
-
"XeusPythonEnv": {
48
-
"packages": ["numpy", "matplotlib", "ipyleaflet"]
49
-
}
50
-
}
59
+
```bash
60
+
jupyter lite build --XeusPythonEnv.environment_file=custom.yml
51
61
```
52
62
63
+
#### About pip dependencies
64
+
65
+
It is common to provide `pip` dependencies in a conda environment file, this is currently **not supported** by xeus-python.
Copy file name to clipboardExpand all lines: docs/configuration.rst
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,26 +6,37 @@ Configuration
6
6
Pre-installed packages
7
7
----------------------
8
8
9
-
xeus-python allows you to pre-install packages in the Python runtime. You can pre-install packages by passing the ``XeusPythonEnv.packages`` CLI option to ``jupyter lite build``.
9
+
``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`.
10
10
11
-
.. note::
12
-
This will automatically install any labextension that it founds, for example installing ipyleaflet will make ipyleaflet work without the need to manually install the jupyter-leaflet labextension.
11
+
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.
13
12
14
-
For example, say you want to install ``NumPy``, ``Matplotlib`` and ``ipyleaflet``, it can be done with the following command:
13
+
Say you want to install ``NumPy``, ``Matplotlib`` and ``ipyleaflet``, it can be done by creating the ``environment.yml`` file with the following content:
15
14
16
15
.. code::
17
16
18
-
jupyter lite build --XeusPythonEnv.packages=numpy,matplotlib,ipyleaflet
17
+
name: xeus-python-kernel
18
+
channels:
19
+
- https://repo.mamba.pm/emscripten-forge
20
+
- https://repo.mamba.pm/conda-forge
21
+
dependencies:
22
+
- numpy
23
+
- matplotlib
24
+
- ipycanvas
19
25
20
-
The same can be achieved through a ``jupyterlite_config.json`` file:
26
+
Then you only need to build JupyterLite:
21
27
22
28
.. code::
23
29
24
-
{
25
-
"XeusPythonEnv": {
26
-
"packages": ["numpy", "matplotlib", "ipyleaflet"]
27
-
}
28
-
}
30
+
jupyter lite build
31
+
32
+
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:
33
+
34
+
.. code::
35
+
36
+
jupyter lite build --XeusPythonEnv.environment_file=custom.yml
37
+
38
+
.. note::
39
+
It is common to provide `pip` dependencies in a conda environment file, this is currently **not supported** by xeus-python.
0 commit comments