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

Commit 2f33657

Browse files
authored
Python 3.11 and new emscripten-wasm32 platform (#164)
* Use the new emscripten-wasm32 platform * Passing --no-pyc to micromamba * Fix distribution name * Fix rebase issue
1 parent cbcb474 commit 2f33657

File tree

10 files changed

+59
-41
lines changed

10 files changed

+59
-41
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defaults:
1111
shell: bash -l {0}
1212

1313
jobs:
14-
build:
14+
lint:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
@@ -24,27 +24,33 @@ jobs:
2424
environment-file: environment.yml
2525
cache-environment: true
2626

27-
- name: Dev install
27+
- name: Lint
2828
run: |
2929
set -eux
3030
jlpm
3131
jlpm run build
3232
jlpm run lint:check
33-
python -m pip install -v .
34-
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK"
33+
34+
build:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Install Conda environment with Micromamba
41+
uses: mamba-org/setup-micromamba@v1
42+
with:
43+
micromamba-version: '1.5.1-0'
44+
environment-file: environment.yml
45+
cache-environment: true
3546

3647
- name: Build the extension
37-
run: |
38-
pip install build
39-
python -m build --sdist
40-
cp dist/*.tar.gz jupyterlite-xeus-python.tar.gz
41-
pip uninstall -y jupyterlite-xeus-python jupyterlab
42-
rm -rf jupyterlite-xeus-python
48+
run: python -m build
4349

4450
- uses: actions/upload-artifact@v2
4551
with:
46-
name: jupyterlite-xeus-python-sdist
47-
path: jupyterlite-xeus-python.tar.gz
52+
name: dist ${{ github.run_number }}
53+
path: ./dist
4854

4955
test_isolated:
5056
needs: build
@@ -60,19 +66,21 @@ jobs:
6066
architecture: 'x64'
6167
- uses: actions/download-artifact@v2
6268
with:
63-
name: jupyterlite-xeus-python-sdist
69+
name: dist ${{ github.run_number }}
70+
path: ./dist
6471
- name: Install and Test
6572
run: |
6673
set -eux
6774
# Remove NodeJS, twice to take care of system and locally installed node versions.
6875
sudo rm -rf $(which node)
6976
sudo rm -rf $(which node)
70-
pip install jupyterlite-xeus-python.tar.gz
77+
pip install jupyterlite_xeus_python*.tar.gz
7178
pip install "jupyterlab==4"
7279
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK"
7380
7481
# TODO: add JupyterLite browser check
7582
# python -m jupyterlab.browser_check --no-chrome-test
83+
working-directory: dist
7684

7785
python-tests-mamba-python:
7886
needs: build
@@ -84,7 +92,8 @@ jobs:
8492

8593
- uses: actions/download-artifact@v2
8694
with:
87-
name: jupyterlite-xeus-python-sdist
95+
name: dist ${{ github.run_number }}
96+
path: ./dist
8897

8998
- name: Install Conda environment with Micromamba
9099
uses: mamba-org/setup-micromamba@v1
@@ -99,7 +108,8 @@ jobs:
99108
python -c "from mamba.api import create"
100109
101110
- name: Install
102-
run: pip install jupyterlite-xeus-python.tar.gz
111+
run: pip install jupyterlite_xeus_python*.tar.gz
112+
working-directory: dist
103113

104114
- name: Run tests
105115
run: pytest -rP test_xeus_python_env.py
@@ -115,7 +125,8 @@ jobs:
115125

116126
- uses: actions/download-artifact@v2
117127
with:
118-
name: jupyterlite-xeus-python-sdist
128+
name: dist ${{ github.run_number }}
129+
path: ./dist
119130

120131
- name: Install Conda environment with Micromamba
121132
uses: mamba-org/setup-micromamba@v1
@@ -125,7 +136,8 @@ jobs:
125136
cache-environment: true
126137

127138
- name: Install
128-
run: pip install jupyterlite-xeus-python.tar.gz
139+
run: pip install jupyterlite_xeus_python*.tar.gz
140+
working-directory: dist
129141

130142
- name: Run tests
131143
run: pytest -rP test_xeus_python_env.py
@@ -141,7 +153,8 @@ jobs:
141153

142154
- uses: actions/download-artifact@v2
143155
with:
144-
name: jupyterlite-xeus-python-sdist
156+
name: dist ${{ github.run_number }}
157+
path: ./dist
145158

146159
- name: Install Conda environment with Micromamba
147160
uses: mamba-org/setup-micromamba@v1
@@ -151,7 +164,8 @@ jobs:
151164
cache-environment: true
152165

153166
- name: Install
154-
run: pip install jupyterlite-xeus-python.tar.gz
167+
run: pip install jupyterlite_xeus_python*.tar.gz
168+
working-directory: dist
155169

156170
- name: Run tests
157171
run: pytest -rP test_xeus_python_env.py
@@ -167,7 +181,8 @@ jobs:
167181

168182
- uses: actions/download-artifact@v2
169183
with:
170-
name: jupyterlite-xeus-python-sdist
184+
name: dist ${{ github.run_number }}
185+
path: ./dist
171186

172187
- name: Install Conda environment with Micromamba
173188
uses: mamba-org/setup-micromamba@v1
@@ -177,7 +192,8 @@ jobs:
177192
cache-environment: true
178193

179194
- name: Install
180-
run: pip install jupyterlite-xeus-python.tar.gz
195+
run: pip install jupyterlite_xeus_python*.tar.gz
196+
working-directory: dist
181197

182198
- name: Run tests
183199
run: pytest -rP test_xeus_python_env.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Say you want to install `NumPy`, `Matplotlib` and `ipycanvas`, it can be done by
4343
name: xeus-python-kernel
4444
channels:
4545
- https://repo.mamba.pm/emscripten-forge
46-
- https://repo.mamba.pm/conda-forge
46+
- conda-forge
4747
dependencies:
4848
- numpy
4949
- matplotlib

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Say you want to install `NumPy`, `Matplotlib` and `ipycanvas`, it can be done by
1414
name: xeus-python-kernel
1515
channels:
1616
- https://repo.mamba.pm/emscripten-forge
17-
- https://repo.mamba.pm/conda-forge
17+
- conda-forge
1818
dependencies:
1919
- numpy
2020
- matplotlib
@@ -73,7 +73,7 @@ For example, if you were to install `ipycanvas` from PyPI, you would need to ins
7373
name: xeus-python-kernel
7474
channels:
7575
- https://repo.mamba.pm/emscripten-forge
76-
- https://repo.mamba.pm/conda-forge
76+
- conda-forge
7777
dependencies:
7878
- numpy
7979
- pillow
@@ -89,7 +89,7 @@ a jupyterlite deployment in your Package documentation, allowing to test the ver
8989
name: xeus-python-kernel
9090
channels:
9191
- https://repo.mamba.pm/emscripten-forge
92-
- https://repo.mamba.pm/conda-forge
92+
- conda-forge
9393
dependencies:
9494
- pip:
9595
- ..

docs/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-python-kernel-docs
22
channels:
33
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
4+
- conda-forge
55
dependencies:
66
- numpy
77
- matplotlib

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ channels:
44
- conda-forge/label/jupyterlite_core_alpha
55
dependencies:
66
- python
7+
- build
78
- pip
89
- jupyterlab >=4.0,<5
910
- jupyterlite-core >=0.2.0a1,<0.3.0

jupyterlite_xeus_python/build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
CONDA_COMMAND = shutil.which("conda")
2727

2828
PYTHON_MAJOR = 3
29-
PYTHON_MINOR = 10
29+
PYTHON_MINOR = 11
3030
PYTHON_VERSION = f"{PYTHON_MAJOR}.{PYTHON_MINOR}"
3131

32-
XEUS_PYTHON_VERSION = "0.15.9"
32+
XEUS_PYTHON_VERSION = "0.15.10"
3333

3434
CHANNELS = [
3535
"https://repo.mamba.pm/emscripten-forge",
36-
"https://repo.mamba.pm/conda-forge",
36+
"conda-forge",
3737
]
3838

39-
PLATFORM = "emscripten-32"
39+
PLATFORM = "emscripten-wasm32"
4040
DEFAULT_REQUEST_TIMEOUT = 1 # in minutes
4141

4242

@@ -74,6 +74,7 @@ def create_env(
7474
MICROMAMBA_COMMAND,
7575
"create",
7676
"--yes",
77+
"--no-pyc",
7778
"--root-prefix",
7879
root_prefix,
7980
"--name",

tests/environment-1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-python-kernel-1
22
channels:
33
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
4+
- conda-forge
55
dependencies:
66
- numpy
77
- matplotlib

tests/environment-2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-python-kernel-2
22
channels:
33
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
4+
- conda-forge
55
dependencies:
66
- pip:
77
# Installing NumPy with pip should fail

tests/test_package/environment-3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-python-kernel-3
22
channels:
33
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
4+
- conda-forge
55
dependencies:
66
- numpy
77
- pip:

tests/test_xeus_python_env.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ def test_python_env_from_file_1():
5050
assert os.path.isfile("/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/bin/xpython_wasm.wasm")
5151

5252
# Checking pip packages
53-
assert os.path.isdir("/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10")
53+
assert os.path.isdir("/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11")
5454
assert os.path.isdir(
55-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages"
55+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages"
5656
)
5757
assert os.path.isdir(
58-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/ipywidgets"
58+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/ipywidgets"
5959
)
6060
assert os.path.isdir(
61-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/ipycanvas"
61+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/ipycanvas"
6262
)
6363
assert os.path.isdir(
64-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/py2vega"
64+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/py2vega"
6565
)
6666

6767
# Checking labextensions
@@ -91,10 +91,10 @@ def test_python_env_from_file_3():
9191

9292
# Test
9393
assert os.path.isdir(
94-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.10/site-packages/test_package"
94+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.11/site-packages/test_package"
9595
)
9696
assert os.path.isfile(
97-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.10/site-packages/test_package/hey.py"
97+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.11/site-packages/test_package/hey.py"
9898
)
9999

100100
os.remove(Path(addon.cwd.name) / "empack_env_meta.json")

0 commit comments

Comments
 (0)