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

Commit 58c946f

Browse files
authored
Merge pull request #16 from martinRenou/update_empack_emsdk
Update emsdk and empack
2 parents 930bcb5 + c2feddc commit 58c946f

File tree

4 files changed

+13
-35
lines changed

4 files changed

+13
-35
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,7 @@ jobs:
131131
python -c "from mamba.api import create"
132132
133133
- name: Install
134-
run: |
135-
emsdk install 3.1.2
136-
emsdk activate 3.1.2
137-
pip install jupyterlite-xeus-python.tar.gz
134+
run: pip install jupyterlite-xeus-python.tar.gz
138135

139136
- name: Run tests
140137
run: pytest -rP tests/test_xeus_python_env.py
@@ -160,10 +157,7 @@ jobs:
160157
mamba-version: "*"
161158

162159
- name: Install
163-
run: |
164-
emsdk install 3.1.2
165-
emsdk activate 3.1.2
166-
pip install jupyterlite-xeus-python.tar.gz
160+
run: pip install jupyterlite-xeus-python.tar.gz
167161

168162
- name: Run tests
169163
run: pytest -rP tests/test_xeus_python_env.py
@@ -188,10 +182,7 @@ jobs:
188182
environment-name: xeus-python-kernel
189183

190184
- name: Install
191-
run: |
192-
emsdk install 3.1.2
193-
emsdk activate 3.1.2
194-
pip install jupyterlite-xeus-python.tar.gz
185+
run: pip install jupyterlite-xeus-python.tar.gz
195186

196187
- name: Run tests
197188
run: pytest -rP tests/test_xeus_python_env.py
@@ -216,10 +207,7 @@ jobs:
216207
python-version: "3.10"
217208

218209
- name: Install
219-
run: |
220-
emsdk install 3.1.2
221-
emsdk activate 3.1.2
222-
pip install jupyterlite-xeus-python.tar.gz
210+
run: pip install jupyterlite-xeus-python.tar.gz
223211

224212
- name: Run tests
225213
run: pytest -rP tests/test_xeus_python_env.py

Dockerfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,8 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
44
ARG PYTHON_VERSION=3.10
55

66
RUN micromamba install --yes -c conda-forge \
7-
git pip python=$PYTHON_VERSION click typer emsdk
8-
9-
##################################################################
10-
# Install empack
11-
##################################################################
12-
13-
RUN pip install empack>=0.5.2
14-
15-
##################################################################
16-
# Setup emsdk
17-
##################################################################
18-
19-
RUN emsdk install 3.1.2 && emsdk activate 3.1.2
7+
git pip python=$PYTHON_VERSION click typer \
8+
"emsdk>=3.1.11" "empack>=0.5.3"
209

2110
##################################################################
2211
# Create emscripten env and pack it

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python
66
- pip
77
- pytest
8-
- emsdk
8+
- emsdk >=3.1.11
9+
- empack >=0.5.3
910
- pip:
1011
- jupyterlite
11-
- empack

jupyterlite_xeus_python/env_build_addon.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def __init__(self, *args, **kwargs):
8181
self.root_prefix = "/tmp/xeus-python-kernel"
8282
self.env_name = "xeus-python-kernel"
8383

84-
self.prefix_path.mkdir(parents=True, exist_ok=True)
84+
# Cleanup tmp dir in case it's not empty
85+
shutil.rmtree(self.root_prefix, ignore_errors=True)
86+
Path(self.root_prefix).mkdir(parents=True, exist_ok=True)
8587

8688
self.orig_config = os.environ.get("CONDARC")
8789

@@ -91,9 +93,6 @@ def pre_build(self, manager):
9193
if not self.packages:
9294
return []
9395

94-
# Cleanup tmp dir
95-
shutil.rmtree(self.root_prefix, ignore_errors=True)
96-
9796
# Create emscripten env with the given packages
9897
self.create_env()
9998

@@ -159,6 +158,8 @@ def create_env(self):
159158
channels.extend(["-c", channel])
160159

161160
if MAMBA_AVAILABLE:
161+
# Mamba needs the directory to exist already
162+
self.prefix_path.mkdir(parents=True, exist_ok=True)
162163
return self._create_env_with_config("mamba", channels)
163164

164165
if MICROMAMBA_AVAILABLE:

0 commit comments

Comments
 (0)