Support Pyodide interpreter in windows (#17658)
## Summary This adds Pyodide interpreter support in windows environment. In Pyodide 0.29.2, we made some enhancements to run Pyodide CLI in windows. This PR relaxes a check that was disabling `uv pip` in Windows + Pyodide and adds integration test. ## Test Plan Added integration test, also tested locally by running ``` uv python install cpython-3.13.2-emscripten-wasm32-musl uv venv venv-pyodide -p cpython-3.13.2-emscripten-wasm32-musl call venv-pyodide\Scripts\activate uv pip install packaging python -c "import packaging" ```
This commit is contained in:
@@ -615,6 +615,43 @@ jobs:
|
||||
./uv pip install packaging
|
||||
python -c 'import packaging'
|
||||
|
||||
integration-test-pyodide-windows:
|
||||
name: "pyodide on windows"
|
||||
timeout-minutes: 10
|
||||
runs-on: windows-latest
|
||||
# Github Actions Windows runner uses D drive as pwd.
|
||||
# Pyodide CLI has an issue running cross-drive,
|
||||
# So ensure that cache and Pyodide paths are on D drive as well.
|
||||
env:
|
||||
UV_CACHE_DIR: D:\uv-cache
|
||||
PYODIDE_XBUILDENV_PATH: D:\pyodide-xbuildenv
|
||||
steps:
|
||||
- name: "Download binary"
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: uv-windows-x86_64-${{ inputs.sha }}
|
||||
|
||||
- name: "Create a native virtual environment"
|
||||
run: |
|
||||
.\uv.exe venv venv-native -p 3.13
|
||||
.\uv.exe pip install -p venv-native\Scripts\python.exe pyodide-build==0.31.1 pip
|
||||
|
||||
- name: "Install Pyodide interpreter"
|
||||
run: |
|
||||
& .\venv-native\Scripts\Activate.ps1
|
||||
pyodide xbuildenv install 0.29.2
|
||||
$env:PYODIDE_PYTHON = pyodide config get interpreter
|
||||
$env:PYODIDE_INDEX = pyodide config get package_index
|
||||
echo "PYODIDE_PYTHON=$env:PYODIDE_PYTHON" >> $env:GITHUB_ENV
|
||||
echo "PYODIDE_INDEX=$env:PYODIDE_INDEX" >> $env:GITHUB_ENV
|
||||
|
||||
- name: "Create Pyodide virtual environment"
|
||||
run: |
|
||||
.\uv.exe venv -p $env:PYODIDE_PYTHON venv-pyodide
|
||||
& .\venv-pyodide\Scripts\Activate.ps1
|
||||
.\uv.exe pip install --extra-index-url=$env:PYODIDE_INDEX --no-build numpy
|
||||
python -c 'import numpy'
|
||||
|
||||
integration-test-github-actions:
|
||||
name: "github actions"
|
||||
timeout-minutes: 10
|
||||
|
||||
Reference in New Issue
Block a user