From d0fd5d5223f5a32f6817314b9768fed0981e0f5e Mon Sep 17 00:00:00 2001 From: Riya Sinha Date: Mon, 28 Oct 2024 14:39:36 -0700 Subject: [PATCH 1/2] Update Pyodide to v0.26.3 --- .github/workflows/ci.yml | 2 +- package.json | 2 +- wasm-preview/run_tests.py | 2 +- wasm-preview/worker.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d2714e13..1338b812d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -341,7 +341,7 @@ jobs: # NOTE!: as per https://github.com/pydantic/pydantic-core/pull/149 this version needs to match the version # in node_modules/pyodide/repodata.json, to get the version, run: # `cat node_modules/pyodide/repodata.json | python -m json.tool | rg platform` - version: '3.1.46' + version: '3.1.58' actions-cache-folder: emsdk-cache - run: pip install 'maturin>=1,<2' 'ruff==0.5.0' typing_extensions diff --git a/package.json b/package.json index 8bb850741..ecfc0372e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "main": "tests/emscripten_runner.js", "dependencies": { "prettier": "^2.7.1", - "pyodide": "^0.25.0" + "pyodide": "^0.26.3" }, "scripts": { "test": "node tests/emscripten_runner.js", diff --git a/wasm-preview/run_tests.py b/wasm-preview/run_tests.py index 776f7a8e2..a9b7956c0 100644 --- a/wasm-preview/run_tests.py +++ b/wasm-preview/run_tests.py @@ -21,7 +21,7 @@ async def main(tests_zip: str, tag_name: str): # File saved on the GH release pydantic_core_wheel = ( 'https://githubproxy.samuelcolvin.workers.dev/pydantic/pydantic-core/releases/' - f'download/{tag_name}/pydantic_core-{tag_name.lstrip("v")}-cp311-cp311-emscripten_3_1_46_wasm32.whl' + f'download/{tag_name}/pydantic_core-{tag_name.lstrip("v")}-cp311-cp311-emscripten_3_1_58_wasm32.whl' ) zip_file = ZipFile(BytesIO(base64.b64decode(tests_zip))) count = 0 diff --git a/wasm-preview/worker.js b/wasm-preview/worker.js index c6223ecbd..93508f1c2 100644 --- a/wasm-preview/worker.js +++ b/wasm-preview/worker.js @@ -89,7 +89,7 @@ async function main() { get(`./run_tests.py?v=${Date.now()}`, 'text'), // e4cf2e2 commit matches the pydantic-core wheel being used, so tests should pass get(zip_url, 'blob'), - importScripts('https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js'), + importScripts('https://cdn.jsdelivr.net/pyodide/v0.26.3/full/pyodide.js'), ]); const pyodide = await loadPyodide(); From e14b93b73c26f4562cdd9d24d4fb189890b68eef Mon Sep 17 00:00:00 2001 From: Riya Sinha Date: Mon, 28 Oct 2024 15:25:53 -0700 Subject: [PATCH 2/2] try using python 3.12 given pyodide error: 'ValueError: Wheel abi 'cp311' is not supported. Supported abis are 'abi3' and 'cp312'.' --- Makefile | 4 ++-- wasm-preview/run_tests.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f860ae6aa..ad9de667b 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,8 @@ endif .PHONY: build-wasm build-wasm: - @echo 'This requires python 3.11, maturin and emsdk to be installed' - maturin build --release --target wasm32-unknown-emscripten --out dist -i 3.11 + @echo 'This requires python 3.12, maturin and emsdk to be installed' + maturin build --release --target wasm32-unknown-emscripten --out dist -i 3.12 ls -lh dist .PHONY: format diff --git a/wasm-preview/run_tests.py b/wasm-preview/run_tests.py index a9b7956c0..03a26e088 100644 --- a/wasm-preview/run_tests.py +++ b/wasm-preview/run_tests.py @@ -21,7 +21,7 @@ async def main(tests_zip: str, tag_name: str): # File saved on the GH release pydantic_core_wheel = ( 'https://githubproxy.samuelcolvin.workers.dev/pydantic/pydantic-core/releases/' - f'download/{tag_name}/pydantic_core-{tag_name.lstrip("v")}-cp311-cp311-emscripten_3_1_58_wasm32.whl' + f'download/{tag_name}/pydantic_core-{tag_name.lstrip("v")}-cp312-cp312-emscripten_3_1_58_wasm32.whl' ) zip_file = ZipFile(BytesIO(base64.b64decode(tests_zip))) count = 0