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

Commit 86d0ab9

Browse files
committed
Update tests
1 parent 1f1107e commit 86d0ab9

File tree

2 files changed

+47
-29
lines changed

2 files changed

+47
-29
lines changed

.github/workflows/build.yml

Lines changed: 40 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,35 @@ 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 eslint: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@v2
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
3748
run: |
3849
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
50+
python -m build
4351
4452
- uses: actions/upload-artifact@v2
4553
with:
46-
name: jupyterlite-xeus-python-sdist
47-
path: jupyterlite-xeus-python.tar.gz
54+
name: dist ${{ github.run_number }}
55+
path: ./dist
4856

4957
test_isolated:
5058
needs: build
@@ -60,19 +68,21 @@ jobs:
6068
architecture: 'x64'
6169
- uses: actions/download-artifact@v2
6270
with:
63-
name: jupyterlite-xeus-python-sdist
71+
name: dist ${{ github.run_number }}
72+
path: ./dist
6473
- name: Install and Test
6574
run: |
6675
set -eux
6776
# Remove NodeJS, twice to take care of system and locally installed node versions.
6877
sudo rm -rf $(which node)
6978
sudo rm -rf $(which node)
70-
pip install jupyterlite-xeus-python.tar.gz
79+
pip install jupyterlite-xeus-python*.tar.gz
7180
pip install "jupyterlab==4"
7281
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK"
7382
7483
# TODO: add JupyterLite browser check
7584
# python -m jupyterlab.browser_check --no-chrome-test
85+
working-directory: dist
7686

7787
python-tests-mamba-python:
7888
needs: build
@@ -84,8 +94,9 @@ jobs:
8494

8595
- uses: actions/download-artifact@v2
8696
with:
87-
name: jupyterlite-xeus-python-sdist
88-
97+
name: dist ${{ github.run_number }}
98+
path: ./dist
99+
89100
- name: Install Conda environment with Micromamba
90101
uses: mamba-org/setup-micromamba@v1
91102
with:
@@ -99,7 +110,8 @@ jobs:
99110
python -c "from mamba.api import create"
100111
101112
- name: Install
102-
run: pip install jupyterlite-xeus-python.tar.gz
113+
run: pip install jupyterlite-xeus-python*.tar.gz
114+
working-directory: dist
103115

104116
- name: Run tests
105117
run: pytest -rP test_xeus_python_env.py
@@ -115,8 +127,9 @@ jobs:
115127

116128
- uses: actions/download-artifact@v2
117129
with:
118-
name: jupyterlite-xeus-python-sdist
119-
130+
name: dist ${{ github.run_number }}
131+
path: ./dist
132+
120133
- name: Install Conda environment with Micromamba
121134
uses: mamba-org/setup-micromamba@v1
122135
with:
@@ -125,7 +138,8 @@ jobs:
125138
cache-environment: true
126139

127140
- name: Install
128-
run: pip install jupyterlite-xeus-python.tar.gz
141+
run: pip install jupyterlite-xeus-python*.tar.gz
142+
working-directory: dist
129143

130144
- name: Run tests
131145
run: pytest -rP test_xeus_python_env.py
@@ -141,7 +155,8 @@ jobs:
141155

142156
- uses: actions/download-artifact@v2
143157
with:
144-
name: jupyterlite-xeus-python-sdist
158+
name: dist ${{ github.run_number }}
159+
path: ./dist
145160

146161
- name: Install Conda environment with Micromamba
147162
uses: mamba-org/setup-micromamba@v1
@@ -151,7 +166,8 @@ jobs:
151166
cache-environment: true
152167

153168
- name: Install
154-
run: pip install jupyterlite-xeus-python.tar.gz
169+
run: pip install jupyterlite-xeus-python*.tar.gz
170+
working-directory: dist
155171

156172
- name: Run tests
157173
run: pytest -rP test_xeus_python_env.py
@@ -167,7 +183,8 @@ jobs:
167183

168184
- uses: actions/download-artifact@v2
169185
with:
170-
name: jupyterlite-xeus-python-sdist
186+
name: dist ${{ github.run_number }}
187+
path: ./dist
171188

172189
- name: Install Conda environment with Micromamba
173190
uses: mamba-org/setup-micromamba@v1
@@ -177,7 +194,8 @@ jobs:
177194
cache-environment: true
178195

179196
- name: Install
180-
run: pip install jupyterlite-xeus-python.tar.gz
197+
run: pip install jupyterlite-xeus-python*.tar.gz
198+
working-directory: dist
181199

182200
- name: Run tests
183201
run: pytest -rP test_xeus_python_env.py

tests/test_xeus_python_env.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ def test_python_env_from_file_1():
6161

6262
# Checking pip packages
6363
assert os.path.isdir(
64-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10"
64+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11"
6565
)
6666
assert os.path.isdir(
67-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages"
67+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages"
6868
)
6969
assert os.path.isdir(
70-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/ipywidgets"
70+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/ipywidgets"
7171
)
7272
assert os.path.isdir(
73-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/ipycanvas"
73+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/ipycanvas"
7474
)
7575
assert os.path.isdir(
76-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.10/site-packages/py2vega"
76+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-1/lib/python3.11/site-packages/py2vega"
7777
)
7878

7979
# Checking labextensions
@@ -103,10 +103,10 @@ def test_python_env_from_file_3():
103103

104104
# Test
105105
assert os.path.isdir(
106-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.10/site-packages/test_package"
106+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.11/site-packages/test_package"
107107
)
108108
assert os.path.isfile(
109-
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.10/site-packages/test_package/hey.py"
109+
"/tmp/xeus-python-kernel/envs/xeus-python-kernel-3/lib/python3.11/site-packages/test_package/hey.py"
110110
)
111111

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

0 commit comments

Comments
 (0)