Skip to content

MAINT Use Pyodide venv rather than js wrapper script #29156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 4 additions & 1 deletion build_tools/azure/install_pyodide.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 10 additions & 2 deletions build_tools/azure/test_script_pyodide.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Loading