Skip to content

Commit efe4ae4

Browse files
authored
update to pyodide 0.28.3 (#223)
* update to pyodide 0.28.3 * update pyproject.toml options, test pyodide constants
1 parent 82b4eed commit efe4ae4

File tree

8 files changed

+70
-32
lines changed

8 files changed

+70
-32
lines changed

examples/jupyter-lite.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@jupyterlite/pyodide-kernel-extension:kernel": {
77
"loadPyodideOptions": {
88
"packages": ["matplotlib", "micropip", "numpy", "sqlite3", "ssl"],
9-
"lockFileURL": "https://cdn.jsdelivr.net/pyodide/v0.28.1/full/pyodide-lock.json?from-lite-config=1"
9+
"lockFileURL": "https://cdn.jsdelivr.net/pyodide/v0.28.3/full/pyodide-lock.json?from-lite-config=1"
1010
}
1111
}
1212
}

jupyterlite_pyodide_kernel/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
PYODIDE_URL_ENV_VAR = "JUPYTERLITE_PYODIDE_URL"
3030

3131
#: probably only compatible with this version of pyodide
32-
PYODIDE_VERSION = "0.28.1"
32+
PYODIDE_VERSION = "0.28.3"
3333

3434
#: the only kind of noarch wheel piplite understands
3535
NOARCH_WHL = "py3-none-any.whl"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1+
from pathlib import Path
2+
13
import jupyterlite_pyodide_kernel
4+
from jupyterlite_pyodide_kernel.constants import PYODIDE_VERSION
5+
6+
import pytest
7+
import re
8+
9+
RE_CDN_ROOT = r"https://cdn.jsdelivr.net/pyodide/v(.*)/full"
10+
RE_CDN_JS_URL = rf"{RE_CDN_ROOT}/pyodide.js"
11+
12+
VERSION_PATH_PATTERNS = {
13+
"packages/pyodide-kernel/package.json": r"\"pyodide\": \"(.*)\"",
14+
"examples/jupyter-lite.json": rf"{RE_CDN_ROOT}/pyodide-lock.json",
15+
"packages/pyodide-kernel-extension/src/index.ts": RE_CDN_JS_URL,
16+
"packages/pyodide-kernel-extension/schema/kernel.v0.schema.json": RE_CDN_JS_URL,
17+
}
218

319

420
def test_labextension_meta():
521
paths = jupyterlite_pyodide_kernel._jupyter_labextension_paths()
622
assert len(paths) == 1
23+
24+
25+
@pytest.mark.parametrize("repo_path", sorted(VERSION_PATH_PATTERNS))
26+
def test_pyodide_versions(repo_path):
27+
path = Path(repo_path)
28+
if not path.exists():
29+
pytest.skip("not in full repo checkout")
30+
31+
text = path.read_text(encoding="utf-8")
32+
pattern = VERSION_PATH_PATTERNS[repo_path]
33+
version = re.search(pattern, text)
34+
assert version, f"no version of pyodide found in {repo_path}: {pattern}"
35+
assert version[1] == PYODIDE_VERSION, f"unexpected pyodide version in {repo_path}"

packages/pyodide-kernel-extension/schema/kernel.v0.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"pyodideUrl": {
99
"description": "The path to the main pyodide.js entry point",
1010
"type": "string",
11-
"default": "https://cdn.jsdelivr.net/pyodide/v0.28.1/full/pyodide.js",
11+
"default": "https://cdn.jsdelivr.net/pyodide/v0.28.3/full/pyodide.js",
1212
"format": "uri"
1313
},
1414
"disablePyPIFallback": {

packages/pyodide-kernel-extension/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const KERNEL_ICON_URL = `data:image/svg+xml;base64,${btoa(KERNEL_ICON_SVG_STR)}`
2020
/**
2121
* The default CDN fallback for Pyodide
2222
*/
23-
const PYODIDE_CDN_URL = 'https://cdn.jsdelivr.net/pyodide/v0.28.1/full/pyodide.js';
23+
const PYODIDE_CDN_URL = 'https://cdn.jsdelivr.net/pyodide/v0.28.3/full/pyodide.js';
2424

2525
/**
2626
* The id for the extension, and key in the litePlugins.

packages/pyodide-kernel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"devDependencies": {
6161
"@babel/core": "^7.22.17",
6262
"esbuild": "^0.19.2",
63-
"pyodide": "0.28.1",
63+
"pyodide": "0.28.3",
6464
"rimraf": "^6.0.1",
6565
"typescript": "~5.2.2"
6666
},

pyproject.toml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ lint = [
6868

6969
test = [
7070
"pytest-console-scripts >=1.4.0",
71-
"pytest-cov",
71+
"pytest-cov <7",
7272
"pytest-html",
7373
"pytest",
7474
]
@@ -97,11 +97,11 @@ exclude = [
9797
"/jupyterlite_pyodide_kernel/tests/fixtures/.pyodide"
9898
]
9999
include = [
100+
"/*.md",
101+
"/install.json",
100102
"/jupyterlite_pyodide_kernel",
101103
"/package.json",
102-
"/install.json",
103104
"/ts*.json",
104-
"/*.md"
105105
]
106106

107107
[tool.hatch.build.targets.wheel]
@@ -113,25 +113,6 @@ include = [
113113
"jupyterlite_pyodide_kernel/labextension" = "share/jupyter/labextensions/@jupyterlite/pyodide-kernel-extension"
114114
"install.json" = "share/jupyter/labextensions/@jupyterlite/pyodide-kernel-extension/install.json"
115115

116-
[tool.pytest.ini_options]
117-
addopts = [
118-
"--pyargs",
119-
"jupyterlite_pyodide_kernel",
120-
"-vv",
121-
# asyncio
122-
"--script-launch-mode=subprocess",
123-
# cov
124-
"--cov=jupyterlite_pyodide_kernel",
125-
"--cov-report=term-missing:skip-covered",
126-
"--cov-report=html:build/reports/htmlcov",
127-
"--cov-branch",
128-
"--cov-fail-under=95",
129-
"--no-cov-on-fail",
130-
# html
131-
"--html=build/reports/pytest.html",
132-
"--self-contained-html",
133-
]
134-
135116
[tool.jupyter-releaser.options]
136117
version_cmd = "python scripts/bump-version.py"
137118

@@ -151,9 +132,37 @@ before-build-python = [
151132
"jlpm build:prod",
152133
]
153134

135+
# non-build tools, sorted by name
154136
[tool.check-wheel-contents]
155137
ignore = ["W002"]
156138

139+
[tool.coverage.paths]
140+
source = [
141+
"jupyterlite_pyodide_kernel/",
142+
"*/site-packages/jupyterlite_pyodide_kernel/"
143+
]
144+
145+
[tool.pytest.ini_options]
146+
addopts = [
147+
"--pyargs",
148+
"jupyterlite_pyodide_kernel",
149+
"-vv",
150+
"--tb=long",
151+
"--color=yes",
152+
# pytest-console-scripts
153+
"--script-launch-mode=subprocess",
154+
# cov
155+
"--cov=jupyterlite_pyodide_kernel",
156+
"--cov-report=term-missing:skip-covered",
157+
"--cov-report=html:build/reports/htmlcov",
158+
"--cov-branch",
159+
"--cov-fail-under=95",
160+
"--no-cov-on-fail",
161+
# html
162+
"--html=build/reports/pytest.html",
163+
"--self-contained-html",
164+
]
165+
157166
[tool.ruff]
158167
cache-dir = "build/.cache/ruff"
159168
extend-include = ["*.ipynb"]

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ __metadata:
11131113
coincident: ^1.2.3
11141114
comlink: ^4.4.2
11151115
esbuild: ^0.19.2
1116-
pyodide: 0.28.1
1116+
pyodide: 0.28.3
11171117
rimraf: ^6.0.1
11181118
typescript: ~5.2.2
11191119
languageName: unknown
@@ -7607,12 +7607,12 @@ __metadata:
76077607
languageName: node
76087608
linkType: hard
76097609

7610-
"pyodide@npm:0.28.1":
7611-
version: 0.28.1
7612-
resolution: "pyodide@npm:0.28.1"
7610+
"pyodide@npm:0.28.3":
7611+
version: 0.28.3
7612+
resolution: "pyodide@npm:0.28.3"
76137613
dependencies:
76147614
ws: ^8.5.0
7615-
checksum: a84604aaf2a0f9e01475c77b58a9cacadf49b42d8f4ab34f8165754a9a954e8b9c7c3bdeaf3977a26652c9b19be47d13467ef82be21d7228a4e6edfd09da5a76
7615+
checksum: bc58b0fd539102b9610d399e9d0ea28f095384766d3ebc995d59c1de06922f946adb78f298a37744a65e4e7bbfde08c61f9884ed85bb541efafcb8e453b901c1
76167616
languageName: node
76177617
linkType: hard
76187618

0 commit comments

Comments
 (0)