Skip to content

Commit 014c9d5

Browse files
committed
ci: use cibuildwheel for pyodide test
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 966533d commit 014c9d5

File tree

6 files changed

+74
-37
lines changed

6 files changed

+74
-37
lines changed

.github/workflows/build-wheels.yml

-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ jobs:
110110
CIBW_BUILD: "${{ matrix.build }}*"
111111
CIBW_ARCHS: ${{ matrix.arch }}
112112
with:
113-
config-file: cibuildwheel.toml
114113
package-dir: awkward-cpp
115114

116115
- name: Check metadata
@@ -156,7 +155,6 @@ jobs:
156155
CIBW_BUILD: cp${{ matrix.python }}-*
157156
CIBW_ARCHS: ${{ matrix.arch }}
158157
with:
159-
config-file: cibuildwheel.toml
160158
package-dir: awkward-cpp
161159

162160
- name: Check metadata

.github/workflows/docs.yml

+29
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,35 @@ env:
1717
SOURCE_DATE_EPOCH: "1668811211"
1818

1919
jobs:
20+
awkward-cpp-wasm:
21+
name: Build C++ WASM
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
33+
- name: Generate build files
34+
run: pipx run nox -s prepare -- --headers --signatures --tests
35+
36+
- uses: pypa/[email protected]
37+
with:
38+
package-dir: awkward-cpp
39+
env:
40+
CIBW_PLATFORM: pyodide
41+
42+
- name: Upload wheel
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: awkward-cpp-wasm
46+
path: awkward-cpp/dist/awkward*wasm32.whl
47+
48+
2049
awkward-cpp-x86-64:
2150
runs-on: ubuntu-22.04
2251
name: Build C++ x86

.github/workflows/packaging-test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,13 @@ jobs:
7373
CIBW_ARCHS_MACOS: universal2
7474
CIBW_BUILD: cp39-win_amd64 cp310-manylinux_x86_64 cp39-macosx_universal2
7575
with:
76-
config-file: cibuildwheel.toml
7776
package-dir: awkward-cpp
7877

7978
- uses: pypa/[email protected]
8079
if: matrix.os == 'ubuntu-latest'
8180
env:
8281
CIBW_BUILD: cp312-manylinux_x86_64
8382
with:
84-
config-file: cibuildwheel.toml
8583
package-dir: awkward-cpp
8684

8785
- name: Upload wheels

awkward-cpp/pyproject.toml

+35
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,38 @@ sdist.include = [
7373
[[tool.scikit-build.overrides]]
7474
if.platform-system = "darwin"
7575
cmake.version = ">=3.29"
76+
77+
78+
[tool.cibuildwheel]
79+
build-frontend = "build[uv]"
80+
test-requires = ["pytest>=6", "."]
81+
test-command = ["echo {project}:", "ls {project}", "echo {package}:", "ls {package}",
82+
"""
83+
pytest -p no:cacheprovider \
84+
{project}/tests \
85+
{package}/tests-cpu-kernels \
86+
{package}/tests-cpu-kernels-explicit \
87+
{package}/tests-spec \
88+
{package}/tests-spec-explicit
89+
"""]
90+
skip = [
91+
"pp*win*",
92+
"pp*-manylinux_i686",
93+
]
94+
test-skip = [
95+
"*universal2:arm64",
96+
"pp*",
97+
"*musllinux*",
98+
]
99+
build-verbosity = 1
100+
101+
[tool.cibuildwheel.environment]
102+
PIP_ONLY_BINARY = "cmake,numpy"
103+
104+
[[tool.cibuildwheel.overrides]]
105+
select = "cp313*"
106+
environment.PYO3_USE_ABI3_FORWARD_COMPATIBILITY = "1"
107+
108+
[[tool.cibuildwheel.overrides]]
109+
select = "*pyodide*"
110+
build-frontend = {name = "build", args = ["--exports", "whole_archive"]}

cibuildwheel.toml

-27
This file was deleted.

tests/test_2682_custom_pickler.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
from __future__ import annotations
44

5-
import multiprocessing
65
import os
76
import pickle
87
import sys
9-
from concurrent.futures import ProcessPoolExecutor
108

119
if sys.version_info < (3, 12):
1210
import importlib_metadata
@@ -22,10 +20,16 @@ def has_entry_point():
2220
return bool(importlib_metadata.entry_points(group="awkward.pickle.reduce").names)
2321

2422

25-
pytestmark = pytest.mark.skipif(
26-
has_entry_point(),
27-
reason="Custom pickler is already registered!",
28-
)
23+
if sys.platform.startswith("emscripten"):
24+
pytestmark = pytest.mark.skip
25+
else:
26+
import multiprocessing
27+
from concurrent.futures import ProcessPoolExecutor
28+
29+
pytestmark = pytest.mark.skipif(
30+
has_entry_point(),
31+
reason="Custom pickler is already registered!",
32+
)
2933

3034

3135
def _init_process_with_pickler(pickler_source: str, tmp_path):

0 commit comments

Comments
 (0)