Skip to content

Commit 534574d

Browse files
jtpiobollwyvl
andauthored
[0.4.x] Support Pyodide 0.27 (#154) (#156)
* bump versions * accept some FS as any * rework piplite * also invert _query_packages ordering * update compatibility matrix Co-authored-by: Nicholas Bollweg <[email protected]>
1 parent 36aedb9 commit 534574d

File tree

14 files changed

+53
-36
lines changed

14 files changed

+53
-36
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ yet work in a full, `jupyter_server`-hosted client such as JupyterLab or Noteboo
4141
| `>=0.1.2,<=0.2.1` | `0.24.*` | `3.10.*` | `3.1.45` |
4242
| `>=0.2.2,<=0.2.3` | `0.25.*` | `3.11.*` | `3.1.46` |
4343
| `>=0.3.*,<=0.4.0` | `0.25.*` | `3.11.*` | `3.1.46` |
44-
| `>=0.4.*,<=0.5.0` | `0.26.*` | `3.12.*` | `3.1.58` |
44+
| `>=0.4.*,<=0.4.6` | `0.26.*` | `3.12.*` | `3.1.58` |
45+
| `>=0.4.7,<=0.5.0` | `0.27.*` | `3.12.*` | `3.1.58` |
4546

4647
Note that the Emscripten version is strict down to the bugfix version.
4748

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.26.4/full/pyodide-lock.json?from-lite-config=1"
9+
"lockFileURL": "https://cdn.jsdelivr.net/pyodide/v0.27.0/full/pyodide-lock.json?from-lite-config=1"
1010
}
1111
}
1212
}

jupyterlite_pyodide_kernel/constants.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Well-known (and otherwise) constants used by ``jupyterlite-pyodide-kernel``"""
22

3-
### pyodide-specific values
3+
### Pyodide-specific values
44
#: the key for PyPI-compatible API responses pointing to wheels
55
PIPLITE_URLS = "pipliteUrls"
66
DISABLE_PYPI_FALLBACK = "disablePyPIFallback"
@@ -10,9 +10,9 @@
1010
KERNEL_SETTINGS_SCHEMA = "kernel.v0.schema.json"
1111
#: where we put wheels, for now
1212
PYPI_WHEELS = "pypi"
13-
#: the plugin id for the pydodide kernel labextension
13+
#: the plugin id for the Pydodide kernel labextension
1414
PYODIDE_KERNEL_PLUGIN_ID = "@jupyterlite/pyodide-kernel-extension:kernel"
15-
#: the npm name of the pyodide kernel
15+
#: the npm name of the Pyodide kernel
1616
PYODIDE_KERNEL_NPM_NAME = PYODIDE_KERNEL_PLUGIN_ID.split(":")[0]
1717
#: the package.json key for piplite
1818
PKG_JSON_PIPLITE = "piplite"
@@ -29,12 +29,20 @@
2929
PYODIDE_URL_ENV_VAR = "JUPYTERLITE_PYODIDE_URL"
3030

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

3434
#: the only kind of noarch wheel piplite understands
3535
NOARCH_WHL = "py3-none-any.whl"
3636

37-
#: the only kind of binary wheel piplite understands
38-
WASM_WHL = "emscripten_*_wasm32.whl"
37+
#: the only kind of binary wheel piplite previously understood
38+
EMSCRIPTEN_ABI_WHL = "emscripten_*_wasm32.whl"
3939

40-
ALL_WHL = [NOARCH_WHL, WASM_WHL]
40+
#: legacy variable alias
41+
WASM_WHL = EMSCRIPTEN_ABI_WHL
42+
43+
#: the Pyodide ABI wheel is the same as the Emscripten
44+
#: ABI wheel, but with a different platform tag, i.e.,
45+
# YYYY_buildnumber.
46+
PYODIDE_ABI_WHL = "pyodide_*_wasm32.whl"
47+
48+
ALL_WHL = [NOARCH_WHL, WASM_WHL, PYODIDE_ABI_WHL]

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.26.4/full/pyodide.js",
11+
"default": "https://cdn.jsdelivr.net/pyodide/v0.27.0/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.26.4/full/pyodide.js';
23+
const PYODIDE_CDN_URL = 'https://cdn.jsdelivr.net/pyodide/v0.27.0/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
@@ -66,7 +66,7 @@
6666
"@types/jest": "^29.5.4",
6767
"esbuild": "^0.19.2",
6868
"jest": "^29.7.0",
69-
"pyodide": "0.26.4",
69+
"pyodide": "0.27.0",
7070
"rimraf": "^5.0.1",
7171
"ts-jest": "^26.3.0",
7272
"typescript": "~5.2.2"

packages/pyodide-kernel/py/piplite/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a companion package to
44
[micropip](https://github.com/pyodide/pyodide/tree/main/packages/micropip) which only
5-
works inside a [pyodide](https://github.com/pyodide/pyodide/) runtime.
5+
works inside a [Pyodide](https://github.com/pyodide/pyodide/) runtime.
66

77
It adds the ability to use extra Warehouse-like API responses to resolve `pip`
88
dependencies, and can disable the fallback to `pypi.org`

packages/pyodide-kernel/py/piplite/piplite/cli.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77
.. code:
88
99
async def install(
10-
requirements: str | list[str],
11-
keep_going: bool = False, # --verbose
12-
deps: bool = True, # --no-deps
13-
credentials: str | None = None,
14-
pre: bool = False, # --pre
15-
) -> None:
10+
self,
11+
requirements: str | list[str], # -r and [packages]
12+
keep_going: bool = False, # --verbose
13+
deps: bool = True, # --no-deps
14+
credentials: str | None = None, # no CLI alias
15+
pre: bool = False, # --pre
16+
index_urls: list[str] | str | None = None, # no CLI alias
17+
*,
18+
verbose: bool | int | None = None,
19+
):
1620
```
1721
18-
As this is _not_ really a CLI, it doesn't bother with accurate return codes, and should
22+
As this is _not_ really a CLI, it doesn't bother with accurate return codes, and
1923
failures should not block execution.
2024
"""
2125

packages/pyodide-kernel/py/piplite/piplite/piplite.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ async def _get_pypi_json_from_index(name, piplite_url, fetch_kwargs) -> ProjectI
7979

8080
async def _query_package(
8181
name: str,
82-
fetch_kwargs: dict[str, Any] | None = None,
8382
index_urls: list[str] | str | None = None,
83+
fetch_kwargs: dict[str, Any] | None = None,
8484
) -> ProjectInfo:
8585
"""Fetch the warehouse API metadata for a specific ``pkgname``."""
8686
for piplite_url in _PIPLITE_URLS:
@@ -99,7 +99,11 @@ async def _query_package(
9999
f"{name} could not be installed: PyPI fallback is disabled"
100100
)
101101

102-
return await _MP_QUERY_PACKAGE(name, fetch_kwargs, index_urls)
102+
return await _MP_QUERY_PACKAGE(
103+
name=name,
104+
index_urls=index_urls,
105+
fetch_kwargs=fetch_kwargs,
106+
)
103107

104108

105109
async def _install(
@@ -174,14 +178,14 @@ def install(
174178
175179
keep_going :
176180
177-
This parameter decides the behavior of the micropip when it encounters a
181+
This parameter decides the behavior of micropip when it encounters a
178182
Python package without a pure Python wheel while doing dependency
179183
resolution:
180184
181185
- If ``False``, an error will be raised on first package with a missing
182186
wheel.
183187
184-
- If ``True``, the micropip will keep going after the first error, and
188+
- If ``True``, micropip will keep going after the first error, and
185189
report a list of errors at the end.
186190
187191
deps :
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# pyodide-kernel
22

33
This is an companion package to [IPython](https://github.com/ipython/ipython) which only
4-
works inside a [pyodide](https://github.com/pyodide/pyodide/) runtime.
4+
works inside a [Pyodide](https://github.com/pyodide/pyodide/) runtime.

0 commit comments

Comments
 (0)