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

Commit 398a035

Browse files
authored
Update empack to 2.0.2 (#89)
1 parent a90ae1f commit 398a035

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG PYTHON_VERSION=3.10
55

66
RUN micromamba install --yes -c conda-forge \
77
git pip python=$PYTHON_VERSION click typer \
8-
"emsdk>=3.1.11" "empack>=0.5.3"
8+
"empack>=2.0.2"
99

1010
##################################################################
1111
# Create emscripten env and pack it
@@ -22,7 +22,7 @@ RUN micromamba create -n xeus-python-kernel \
2222
RUN mkdir -p xeus-python-kernel && cd xeus-python-kernel && \
2323
cp /tmp/xeus-python-kernel/envs/xeus-python-kernel/bin/xpython_wasm.js . && \
2424
cp /tmp/xeus-python-kernel/envs/xeus-python-kernel/bin/xpython_wasm.wasm . && \
25-
empack pack env --env-prefix /tmp/xeus-python-kernel/envs/xeus-python-kernel --outname python_data --config /opt/conda/share/empack/empack_config.yaml
25+
empack pack env --env-prefix /tmp/xeus-python-kernel/envs/xeus-python-kernel --outname python_data
2626

2727
COPY copy_output.sh .
2828

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ dependencies:
66
- pip
77
- pytest
88
- emsdk >=3.1.11
9-
- empack >=0.5.3
9+
- empack >=2.0.2
1010
- pip:
1111
- jupyterlite

jupyterlite_xeus_python/env_build_addon.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ class XeusPythonEnv(FederatedExtensionAddon):
8080
)
8181

8282
empack_config = Unicode(
83-
"https://raw.githubusercontent.com/emscripten-forge/recipes/main/empack_config.yaml",
83+
None,
8484
config=True,
85+
allow_none=True,
8586
description="The path or URL to the empack config file",
8687
)
8788

@@ -134,23 +135,25 @@ def post_build(self, manager):
134135
# Create emscripten env with the given packages
135136
self.create_env()
136137

138+
pack_kwargs = {}
139+
137140
# Download env filter config
138-
empack_config_is_url = urlparse(self.empack_config).scheme in ("http", "https")
139-
if empack_config_is_url:
140-
empack_config_content = requests.get(self.empack_config).content
141-
pkg_file_filter = PkgFileFilter.parse_obj(
142-
yaml.safe_load(empack_config_content)
143-
)
144-
else:
145-
pkg_file_filter = pkg_file_filter_from_yaml(self.empack_config)
141+
if self.empack_config is not None:
142+
empack_config_is_url = urlparse(self.empack_config).scheme in ("http", "https")
143+
if empack_config_is_url:
144+
empack_config_content = requests.get(self.empack_config).content
145+
pack_kwargs["pkg_file_filter"] = PkgFileFilter.parse_obj(
146+
yaml.safe_load(empack_config_content)
147+
)
148+
else:
149+
pack_kwargs["pkg_file_filter"] = pkg_file_filter_from_yaml(self.empack_config)
146150

147151
# Pack the environment
148152
pack_environment(
149153
env_prefix=self.prefix_path,
150154
outname=Path(self.cwd.name) / "python_data",
151155
export_name="globalThis.Module",
152-
pkg_file_filter=pkg_file_filter,
153-
download_emsdk="latest",
156+
**pack_kwargs,
154157
)
155158

156159
# Find the federated extensions in the emscripten-env and install them

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"traitlets",
5858
"jupyterlite",
5959
"requests",
60-
"empack>=1.0.0,<2",
60+
"empack>=2.0.2,<3",
6161
],
6262
zip_safe=False,
6363
include_package_data=True,

0 commit comments

Comments
 (0)