Skip to content

Commit c8fd10a

Browse files
committed
ci: build the pure-Python (py3-none-any) wheel as a pinned-artifact for wasm consumers
VPYTHON_PURE_PYTHON=1 wheel built on every push to master/pyodide-packaging, verified pure + importable, sha256-summed, uploaded as an actions artifact, and attached to GitHub releases. Downstream (trinket) pins by URL + sha256. Also gitignore local virtualenvs.
1 parent 2504893 commit c8fd10a

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/pure-wheel.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Pure-Python wheel (wasm/Pyodide)
2+
3+
# Builds the VPYTHON_PURE_PYTHON=1 wheel (py3-none-any) that Pyodide/micropip
4+
# and other wasm targets can install — they cannot use platform wheels.
5+
# Consumers (e.g. trinket) pin the artifact by URL + sha256; a GitHub release
6+
# gets the wheel attached automatically so pins survive artifact expiry.
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches: [master, pyodide-packaging]
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
pure-wheel:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write # needed only for the release-asset upload step
20+
steps:
21+
- uses: actions/checkout@v7
22+
with:
23+
fetch-depth: 0 # setuptools_scm-style dev versions need history
24+
25+
- uses: actions/setup-python@v6
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Build pure wheel
30+
run: |
31+
pip install build
32+
VPYTHON_PURE_PYTHON=1 python -m build --wheel --outdir dist
33+
ls -l dist
34+
35+
- name: Verify wheel is py3-none-any and imports
36+
run: |
37+
python - <<'EOF'
38+
import glob, sys
39+
w = glob.glob('dist/*.whl')
40+
assert w and w[0].endswith('py3-none-any.whl'), f"not a pure wheel: {w}"
41+
print("pure wheel:", w[0])
42+
EOF
43+
pip install dist/*.whl
44+
python -c "import vpython; print('import ok', vpython.__version__)"
45+
46+
- name: Checksum
47+
run: shasum -a 256 dist/*.whl | tee dist/SHA256SUMS
48+
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: vpython-pure-wheel
52+
path: dist/
53+
54+
- name: Attach wheel to release
55+
if: github.event_name == 'release'
56+
env:
57+
GH_TOKEN: ${{ github.token }}
58+
run: gh release upload "${{ github.event.release.tag_name }}" dist/*.whl dist/SHA256SUMS --clobber

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ docs/_build/
6464

6565
# PyBuilder
6666
target/
67+
68+
# local virtualenvs
69+
.venv/
70+
venv/

0 commit comments

Comments
 (0)