Skip to content

Commit 9f52eb6

Browse files
committed
Support PEP 783 (pypi emscripten wheels)
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 4d7d220 commit 9f52eb6

5 files changed

Lines changed: 32 additions & 8 deletions

File tree

.github/workflows/build.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ jobs:
393393
arch:
394394
- x86_64
395395
python-version:
396-
- 3.11
396+
- "3.13"
397397
node-version: [22.x]
398398
steps:
399399
- name: Checkout
@@ -424,6 +424,24 @@ jobs:
424424
PACKAGE: "python"
425425
CI: 1
426426

427+
- name: Verify wheel is PyPI-compatible (PEP 783)
428+
shell: bash
429+
run: |
430+
python -m pip install --quiet twine
431+
shopt -s nullglob
432+
wheels=(rust/target/wheels/*.whl)
433+
if [ ${#wheels[@]} -eq 0 ]; then
434+
echo "::error::no emscripten wheel was produced"; exit 1
435+
fi
436+
for w in "${wheels[@]}"; do
437+
echo "checking $w"
438+
case "$w" in
439+
*pyemscripten_2025_0_wasm32.whl) ;;
440+
*) echo "::error::$w is not tagged pyemscripten_2025_0_wasm32"; exit 1 ;;
441+
esac
442+
done
443+
python -m twine check rust/target/wheels/*.whl
444+
427445
- uses: actions/upload-artifact@v4
428446
with:
429447
name: perspective-python-dist-wasm32-emscripten-${{ matrix.python-version }}
@@ -441,7 +459,7 @@ jobs:
441459
arch:
442460
- x86_64
443461
python-version:
444-
- 3.11
462+
- "3.13"
445463
node-version: [22.x]
446464
steps:
447465
- name: Checkout
@@ -996,7 +1014,7 @@ jobs:
9961014

9971015
- uses: actions/download-artifact@v4
9981016
with:
999-
name: perspective-python-dist-wasm32-emscripten-3.11
1017+
name: perspective-python-dist-wasm32-emscripten-3.13
10001018

10011019
- uses: actions/download-artifact@v4
10021020
with:

rust/perspective-python/build.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ if (!!process.env.PSP_DEBUG) {
2929
flags = "";
3030
}
3131

32-
const python_version = process.env.PSP_PYTHON_VERSION || "3.12";
3332
const is_pyodide = !!process.env.PSP_PYODIDE;
3433

34+
const python_version =
35+
process.env.PSP_PYTHON_VERSION || (is_pyodide ? "3.13" : "3.12");
36+
3537
const version = pkg.version;
3638

3739
fs.mkdirSync(`./perspective_python-${version}.data`, { recursive: true });
@@ -47,6 +49,8 @@ if (is_pyodide) {
4749
fs.readFileSync(path.resolve(__dirname, "../../package.json")),
4850
);
4951
emsdk_prefix = `cd ${emsdkdir} && . ./emsdk_env.sh && ./emsdk activate ${emscripten} && cd ${cwd} && `;
52+
env.MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION =
53+
process.env.MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION || "2025_0";
5054
}
5155

5256
// if not windows

rust/perspective-python/pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

1313
[build-system]
14-
requires = ["maturin>=1.4,<2.0"]
14+
requires = ["maturin>=1.13.3,<2.0"]
1515
build-backend = "maturin"
1616

1717
[project]
1818
name = "perspective-python"
1919
requires-python = ">=3.9"
2020
dynamic = ["version"]
2121
dependencies = []
22-
license = { file = "LICENSE.md" }
22+
license = "Apache-2.0"
23+
license-files = ["LICENSE.md"]
2324
classifiers = [
2425
"Development Status :: 5 - Production/Stable",
2526
"Programming Language :: Rust",
@@ -29,6 +30,7 @@ classifiers = [
2930
"Programming Language :: Python :: 3.10",
3031
"Programming Language :: Python :: 3.11",
3132
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3234
"Framework :: Jupyter :: JupyterLab",
3335
"Framework :: Jupyter :: JupyterLab :: 3",
3436
"Framework :: Jupyter :: JupyterLab :: Extensions",

rust/perspective-python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Faker==26.0.0
44
ipywidgets==8.1.3
55
jupyterlab_git==0.50.1
66
jupyterlab==4.2.3
7-
maturin==1.10.2
7+
maturin==1.14.1
88
numpy==2.2.6
99
packaging==24.1
1010
pandas==2.3.0

tools/scripts/workspace.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function getRustWheelsDir() {
4242

4343
export function getEmscriptenWheelPath() {
4444
const pspVersion = getWorkspacePackageJson().version.replace("-", ".");
45-
const wheeljunk = "cp311-abi3-emscripten_4_0_9_wasm32";
45+
const wheeljunk = "cp311-abi3-pyemscripten_2025_0_wasm32";
4646
return path.join(
4747
rustWheelsDir,
4848
`perspective_python-${pspVersion}-${wheeljunk}.whl`,

0 commit comments

Comments
 (0)