diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9b0e8c2259f19..3599c82e3c9bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -124,11 +124,11 @@ jobs: vmImage: ubuntu-22.04 variables: # Need to match Python version and Emscripten version for the correct - # Pyodide version. For example, for Pyodide version 0.25.1, see - # https://github.com/pyodide/pyodide/blob/0.25.1/Makefile.envs - PYODIDE_VERSION: '0.25.1' - EMSCRIPTEN_VERSION: '3.1.46' - PYTHON_VERSION: '3.11.3' + # Pyodide version. For example, for Pyodide version 0.26.0, see + # https://github.com/pyodide/pyodide/blob/0.26.0/Makefile.envs + PYODIDE_VERSION: '0.26.0' + EMSCRIPTEN_VERSION: '3.1.58' + PYTHON_VERSION: '3.12.1' dependsOn: [git_commit, linting] condition: | diff --git a/build_tools/azure/install_pyodide.sh b/build_tools/azure/install_pyodide.sh old mode 100644 new mode 100755 index 58d0348a53202..bdbdef7e0bd7c --- a/build_tools/azure/install_pyodide.sh +++ b/build_tools/azure/install_pyodide.sh @@ -17,4 +17,7 @@ ls -ltrh dist # The Pyodide js library is needed by build_tools/azure/test_script_pyodide.sh # to run tests inside Pyodide -npm install pyodide@$PYODIDE_VERSION +# npm install pyodide@$PYODIDE_VERSION +pyodide venv .pyodide-venv +source .pyodide-venv/bin/activate +pip install dist/*.whl diff --git a/build_tools/azure/test_script_pyodide.sh b/build_tools/azure/test_script_pyodide.sh old mode 100644 new mode 100755 index d1aa207f864a2..8b90d1b8ca6ac --- a/build_tools/azure/test_script_pyodide.sh +++ b/build_tools/azure/test_script_pyodide.sh @@ -1,9 +1,17 @@ #!/bin/bash -set -e +set -ex # We are using a pytest js wrapper script to run tests inside Pyodide. Maybe # one day we can use a Pyodide venv instead but at the time of writing # (2023-09-27) there is an issue with scipy.linalg in a Pyodide venv, see # https://github.com/pyodide/pyodide/issues/3865 for more details. -node build_tools/azure/pytest-pyodide.js --pyargs sklearn --durations 20 --showlocals +# node build_tools/azure/pytest-pyodide.js --pyargs sklearn --durations 20 --showlocals +source .pyodide-venv/bin/activate +which pip +pip install pytest +df -h +cd /tmp +which pytest +python -c 'import sklearn; print(sklearn.__file__)' +pytest --pyargs sklearn --durations 20 --showlocals