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

Commit 89f548a

Browse files
authored
Support both jupyterlite 0.1 and 0.2 (#188)
* Support both jupyterlite 0.1 and 0.2 * Update jupyterlite in docs
1 parent b00d80d commit 89f548a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

docs/build-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- pydata-sphinx-theme
1414
- yarn
1515
- jupyterlab >=3.5.3,<3.6
16-
- jupyterlite-core >=0.1.0,<0.2.0
16+
- jupyterlite-core >=0.1.0,<0.3.0
1717
- jupyterlite-sphinx >=0.9.1
1818
- empack >=3.1.0
1919
- pip:

jupyterlite_xeus_python/env_build_addon.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
UTF8,
2323
FEDERATED_EXTENSIONS,
2424
)
25-
from jupyterlite_core.addons.federated_extensions import (
26-
FederatedExtensionAddon,
27-
ENV_EXTENSIONS,
28-
)
25+
from jupyterlite_core.addons.federated_extensions import FederatedExtensionAddon
2926

3027
from .build import XEUS_PYTHON_VERSION, build_and_pack_emscripten_env
3128

@@ -73,8 +70,15 @@ def __init__(self, *args, **kwargs):
7370

7471
def post_build(self, manager):
7572
"""yield a doit task to create the emscripten-32 env and grab anything we need from it"""
73+
try:
74+
# JupyterLite 0.1.x
75+
from jupyterlite_core.addons.federated_extensions import ENV_EXTENSIONS as env_extensions
76+
except ImportError:
77+
# JupyterLite 0.2.x
78+
env_extensions = self.labextensions_path
79+
7680
# Install the jupyterlite-xeus-python ourselves
77-
for pkg_json in self.env_extensions(ENV_EXTENSIONS):
81+
for pkg_json in self.env_extensions(env_extensions):
7882
pkg_data = json.loads(pkg_json.read_text(**UTF8))
7983
if pkg_data.get("name") == JUPYTERLITE_XEUS_PYTHON:
8084
yield from self.safe_copy_extension(pkg_json)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
packages=setuptools.find_packages(exclude=["tests"]),
6060
install_requires=[
6161
"traitlets",
62-
"jupyterlite-core>=0.1,<0.2",
62+
"jupyterlite-core>=0.1,<0.3",
6363
"requests",
6464
"empack>=3.1,<4",
6565
"typer",

0 commit comments

Comments
 (0)