-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5e539a
commit 31f736f
Showing
11 changed files
with
115 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Related Projects | ||
|
||
## Pyodide | ||
|
||
[Pyodide](https://pyodide.org/en/stable/index.html) is a Python distribution for the browser and Node.js based on WebAssembly. | ||
Emscripten-forge would not have been possible without the pioneering work of the pyodide team. | ||
Many aspects of this project are heavily inspired by the pyodide project. This includes the build scripts and many of the patches which have been taken from the pyodide packages. | ||
|
||
|
||
## pyjs | ||
[pyjs](https://emscripten-forge.github.io/pyjs/) is modern pybind11 + emscripten Embind based Python <-> JavaScript foreign function interface (FFI) for wasm/emscripten compiled Python. | ||
The API is loosly based on the FFI of pyodide. | ||
|
||
## pyjs-code-runner | ||
[pyjs-code-runner](https://github.com/emscripten-forge/pyjs-code-runner) is a "driver" to run python code in a wasm environment, almost like running vanilla python code. This is used to run the tests of the emscripten-forge packages. | ||
|
||
## JupyterLite | ||
[JupyterLite](https://jupyterlite.readthedocs.io/en/stable/) is a JupyterLab distribution that runs entirely in the browser built from the ground-up using JupyterLab components and extensions. | ||
|
||
|
||
## JupyterLite Xeus | ||
|
||
[jupyterlite-xeus](https://github.com/jupyterlite/xeus) is a package/jupyterlite extension to use xeus-kernels | ||
and packages from emscripten-forge in a jupyterlite environment. | ||
|
||
|
||
## rattler-build | ||
|
||
[rattler-build](https://github.com/prefix-dev/rattler-build) is used to build the emscripten-forge packages | ||
|
||
## pixi | ||
|
||
[pixi](https://pixi.sh/latest/) is a package management tool for developers. It allows the developer to install libraries and applications in a reproducible way. | ||
Emscripten-forge uses pixi to setup the environment for building the packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#Installing packages | ||
|
||
## Install packages with micromamba | ||
We recommend using micromamba to install packages from this channel. | ||
To install micromamba itself, follow the instructions in the [micromamba documentation](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html#micromamba-installation). | ||
|
||
To install packages from this channel, use the following command: | ||
|
||
```bash | ||
micromamba create -n my-channel-name \ | ||
--platform=emscripten-wasm32 \ | ||
-c https://repo.mamba.pm/emscripten-forge \ | ||
-c https://repo.mamba.pm/conda-forge \ | ||
--yes \ | ||
python numpy scipy matplotlib | ||
``` | ||
|
||
All noarch packages are installed from the `conda-forge` channel, all packages compiled for the `emscripten-wasm32` platform are provided via the `emscripten-forge` channel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# JupyterLite Xeus | ||
|
||
|
||
## Installation | ||
|
||
To consume emscripten-forge packages in JupyterLite environment, the `jupyterlite_xeus` package needs | ||
to be installed. This can be done with `pip` | ||
|
||
```bash | ||
pip install jupyterlite_xeus | ||
``` | ||
or `conda`/`mamba`/`micromamba` | ||
|
||
``` | ||
mamba install jupyterlite_xeus | ||
``` | ||
|
||
## Usage | ||
|
||
!!! note | ||
|
||
Emscripten-forge provides xeus kernels for multiple languages, this document focuses on the Python kernel, namely `xeus-python`. | ||
While the other kernels can also be installed as described below, adding custom packages is only supported for the `xeus-python` kernel | ||
at the moment. | ||
|
||
### From environment file | ||
|
||
To load a xeus-python kernel with a custom environment, create an environment.yaml file with xeus-python and the desired dependencies. Here is an example with numpy as a additional dependency: | ||
```yaml | ||
name: xeus-lite-wasm | ||
channels: | ||
- https://repo.mamba.pm/emscripten-forge | ||
- conda-forge | ||
dependencies: | ||
- xeus-python | ||
- numpy | ||
``` | ||
To build JupyterLite, run the following command where environment.yaml is the path to the file you just created | ||
```bash | ||
jupyter lite build --XeusAddon.environment_file=some_path/to/environment.yaml | ||
``` | ||
|
||
### From prefix | ||
Create a environment with the desired packages. Here is an example with numpy as a additional dependency | ||
|
||
```bash | ||
micromamba create | ||
-n myenv \ | ||
--platform=emscripten-wasm32 \ | ||
-c https://repo.mamba.pm/emscripten-forge \ | ||
-c conda-forge \ | ||
--yes \ | ||
"python>=3.11" numpy pandas xeus-python | ||
``` | ||
|
||
jupyter lite build --XeusAddon.prefix=$MAMBA_ROOT_PREFIX/envs/myenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters