From ce42085212fa0efd0c3b5e8d51f80179717750b2 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Wed, 5 Feb 2025 09:51:01 +0000 Subject: [PATCH 1/3] fix wasm preview --- wasm-preview/run_tests.py | 2 +- wasm-preview/worker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wasm-preview/run_tests.py b/wasm-preview/run_tests.py index 03a26e088..817df0195 100644 --- a/wasm-preview/run_tests.py +++ b/wasm-preview/run_tests.py @@ -37,7 +37,7 @@ async def main(tests_zip: str, tag_name: str): print(f'Mounted {count} test files, installing dependencies...') - await micropip.install(['dirty-equals', 'hypothesis', 'pytest-speed', 'pytest-mock', pydantic_core_wheel, 'tzdata']) + await micropip.install(['dirty-equals', 'hypothesis', 'pytest-speed', 'pytest-mock', 'tzdata', 'inline-snapshot', pydantic_core_wheel]) importlib.invalidate_caches() # print('installed packages:') diff --git a/wasm-preview/worker.js b/wasm-preview/worker.js index 93508f1c2..13414cdb5 100644 --- a/wasm-preview/worker.js +++ b/wasm-preview/worker.js @@ -97,7 +97,7 @@ async function main() { setupStreams(FS, pyodide._module.TTY); FS.mkdir('/test_dir'); FS.chdir('/test_dir'); - await pyodide.loadPackage(['micropip', 'pytest', 'numpy']); + await pyodide.loadPackage(['micropip', 'pytest', 'numpy', 'pygments']); if (pydantic_core_version < '2.0.0') await pyodide.loadPackage(['typing-extensions']); await pyodide.runPythonAsync(python_code, {globals: pyodide.toPy({pydantic_core_version, tests_zip})}); post(); From b1b72feac835caaabaa894b0a3ae0e62d85aefa8 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Wed, 5 Feb 2025 18:01:27 +0000 Subject: [PATCH 2/3] formatting --- pyproject.toml | 11 +++++++++-- wasm-preview/run_tests.py | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa1f29011..4cc23037a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,8 +27,15 @@ classifiers = [ 'Operating System :: MacOS', 'Typing :: Typed', ] -dependencies = ['typing-extensions >=4.6.0,!=4.7.0'] -dynamic = ['description', 'license', 'readme', 'version'] +dependencies = [ + 'typing-extensions>=4.6.0,!=4.7.0' +] +dynamic = [ + 'description', + 'license', + 'readme', + 'version' +] [project.urls] Homepage = 'https://github.com/pydantic/pydantic-core' diff --git a/wasm-preview/run_tests.py b/wasm-preview/run_tests.py index 817df0195..806e01164 100644 --- a/wasm-preview/run_tests.py +++ b/wasm-preview/run_tests.py @@ -37,7 +37,9 @@ async def main(tests_zip: str, tag_name: str): print(f'Mounted {count} test files, installing dependencies...') - await micropip.install(['dirty-equals', 'hypothesis', 'pytest-speed', 'pytest-mock', 'tzdata', 'inline-snapshot', pydantic_core_wheel]) + await micropip.install( + ['dirty-equals', 'hypothesis', 'pytest-speed', 'pytest-mock', 'tzdata', 'inline-snapshot', pydantic_core_wheel] + ) importlib.invalidate_caches() # print('installed packages:') From a00077ba37c01d1054e548cccb99efa0467cad3e Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Wed, 5 Feb 2025 18:08:15 +0000 Subject: [PATCH 3/3] revert pyproject change --- pyproject.toml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4cc23037a..27b54938d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,15 +27,8 @@ classifiers = [ 'Operating System :: MacOS', 'Typing :: Typed', ] -dependencies = [ - 'typing-extensions>=4.6.0,!=4.7.0' -] -dynamic = [ - 'description', - 'license', - 'readme', - 'version' -] +dependencies = ['typing-extensions>=4.6.0,!=4.7.0'] +dynamic = ['description', 'license', 'readme', 'version'] [project.urls] Homepage = 'https://github.com/pydantic/pydantic-core'