Skip to content

Commit 9da3c7b

Browse files
authored
Merge pull request #250 from ducflair/jorgedanisc
chore: update Pyodide wheel compatibility check to use wheel_platform…
2 parents 66feae2 + 75cd55d commit 9da3c7b

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,30 +235,27 @@ jobs:
235235
236236
# Install cross-build environment
237237
pyodide xbuildenv install 0.29.3
238-
239-
# Derive PYODIDE_ROOT directly — the xbuildenv install prints its path,
240-
# and pyodide config requires a Makefile that only exists inside a full
241-
# Pyodide checkout, not in the standalone xbuildenv.
242238
XBUILD_DIR="$(pwd)/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
243239
if [ ! -d "$XBUILD_DIR/pyodide-root" ]; then
244-
# Fall back to home-directory location (used outside CI workdirs)
245240
XBUILD_DIR="$HOME/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
246241
fi
247242
export PYODIDE_ROOT="$XBUILD_DIR/pyodide-root"
248243
echo "PYODIDE_ROOT=$PYODIDE_ROOT"
249244
250-
# Check wheel platform tag — must contain pyodide_* for Pyodide 0.29.3 compat
245+
# Check wheel platform tag — this is the tag used in the .whl filename.
246+
# pyodide_tags() returns install-compatibility tags (emscripten first), but
247+
# wheel_platform() returns the actual build platform tag (e.g. pyodide_2025_0_wasm32).
251248
TAG=$(python3 -c "
252249
import os
253250
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
254-
from pyodide_build.build_env import pyodide_tags
255-
print(next(iter(pyodide_tags())))
251+
from pyodide_build.build_env import wheel_platform
252+
print(wheel_platform())
256253
")
257-
echo "Pyodide primary wheel tag: $TAG"
254+
echo "Pyodide wheel platform tag: $TAG"
258255
if echo "$TAG" | grep -q "pyodide_"; then
259-
echo "Wheel tag includes pyodide_* — OK"
256+
echo "Wheel platform tag is pyodide_* — OK (compatible with Pyodide 0.29.3 runtime)"
260257
else
261-
echo "ERROR: Wheel tag does not include pyodide_*. Got: $TAG"
258+
echo "ERROR: Wheel platform tag is '$TAG', expected pyodide_*"
262259
echo "This means the built wheel will NOT be compatible with the Pyodide 0.29.3 runtime."
263260
exit 1
264261
fi

.github/workflows/release-ducpy.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,33 @@ jobs:
8080
if [ ! -d "$XBUILD_DIR/pyodide-root" ]; then
8181
XBUILD_DIR="$HOME/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
8282
fi
83+
export PYODIDE_ROOT="$XBUILD_DIR/pyodide-root"
84+
85+
# Get Emscripten version (needed for emsdk setup)
8386
EMSCRIPTEN_VERSION=$(python3 -c "
8487
import os
85-
os.environ['PYODIDE_ROOT'] = '$XBUILD_DIR/pyodide-root'
88+
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
8689
from pyodide_build.build_env import get_build_environment_vars
8790
from pathlib import Path
8891
print(get_build_environment_vars(Path(os.environ['PYODIDE_ROOT']))['PYODIDE_EMSCRIPTEN_VERSION'])
8992
")
9093
echo "emscripten_version=${EMSCRIPTEN_VERSION}" >> $GITHUB_OUTPUT
9194
95+
# Verify wheel platform tag is pyodide_* (not pyemscripten_*)
96+
TAG=$(python3 -c "
97+
import os
98+
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
99+
from pyodide_build.build_env import wheel_platform
100+
print(wheel_platform())
101+
")
102+
echo "Pyodide wheel platform tag: $TAG"
103+
if echo "$TAG" | grep -q "pyodide_"; then
104+
echo "Wheel platform tag is pyodide_* — OK"
105+
else
106+
echo "ERROR: Wheel platform tag is '$TAG', expected pyodide_*"
107+
exit 1
108+
fi
109+
92110
- name: Setup Emscripten SDK
93111
if: steps.release.outputs.status == 'success'
94112
uses: mymindstorm/setup-emsdk@v14

0 commit comments

Comments
 (0)