Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Xeus python build addon #10

Merged
merged 2 commits into from May 19, 2022

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented May 16, 2022

JupyterLite command line addon.

This adds a --XeusPythonEnv.packages CLI option to jupyter lite build allowing to install Python package in the xeus-python-lite deployment:

jupyter lite build --XeusPythonEnv.packages=numpy,matplotlib,ipywidgets

yeaaah

The important changes from the PR are the following:

  • Build xeus-python-kernel under the path /tmp/xeus-python-kernel in the DockerFile
  • Add a new entry point for jupyterlite in the Python package
    • This new entry point adds the XeusPythonEnv jupyterlite addon which allows to create a custom emscripten-32 conda env that will be used for the xeus-python deployment
    • This env is created under the same path as the docker build /tmp/xeus-python-kernel
    • Once the env is created and packed with emboa, we move the resulting python_data.data and python_data.js at the right place for the labextension to fetch.

TODO:

@jtpio jtpio added the enhancement New feature or request label May 16, 2022
@jtpio
Copy link
Member

jtpio commented May 16, 2022

Really cool!

This adds a --XeusPythonEnv.packages CLI option to jupyter lite build allowing to install Python package in the xeus-python-lite deployment:

Note for later: it will also be possible to configure this with a XeusPythonEnv key in a jupyter_lite_config.json file.

@martinRenou martinRenou force-pushed the xeus-python-build-addon branch 2 times, most recently from 68427dc to 9a9dfc1 Compare May 17, 2022 12:53

if not self.is_sys_prefix_ignored():
for pkg_json in self.env_extensions(root):
yield from self.copy_one_extension(pkg_json)
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

Wondering how this would interact with the existing --ignore-sys-prefix lite flag? (to not pick up extensions from the build environment)

Maybe it's fine in that case, since the prebuilt lab extensions come from a separate (emscripten) env.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess a sensible approach for the xeus-python addon would be to ignore that flag? (I'll check if it is ignored)

A typical user would probably always want to have the labextensions from the emscripten env be included? Otherwise they would not have installed them.

@martinRenou
Copy link
Member Author

Note for later: it will also be possible to configure this with a XeusPythonEnv key in a jupyter_lite_config.json file.

Indeed! I should add some documentation for this.

@martinRenou martinRenou force-pushed the xeus-python-build-addon branch 4 times, most recently from a5811cd to b94e1dc Compare May 19, 2022 07:48
@martinRenou martinRenou marked this pull request as ready for review May 19, 2022 11:15
@martinRenou martinRenou merged commit dc26bbd into jupyterlite:main May 19, 2022
@martinRenou martinRenou deleted the xeus-python-build-addon branch May 19, 2022 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants