File tree Expand file tree Collapse file tree 7 files changed +96
-3
lines changed Expand file tree Collapse file tree 7 files changed +96
-3
lines changed Original file line number Diff line number Diff line change 1+ name : WASM
2+
3+ on :
4+ workflow_dispatch :
5+ pull_request :
6+ branches :
7+ - master
8+
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ build-wasm-emscripten :
15+ name : Pyodide wheel
16+ runs-on : ubuntu-22.04
17+ steps :
18+ - uses : actions/checkout@v3
19+ with :
20+ submodules : true
21+ fetch-depth : 0
22+
23+ - uses : actions/setup-python@v4
24+ with :
25+ python-version : " 3.11"
26+
27+ - name : Install pyodide-build
28+ run : pip install pyodide-build==0.23.4
29+
30+ - name : Compute emsdk version
31+ id : compute-emsdk-version
32+ run : |
33+ # Prepare xbuild environment (side-effect)
34+ pyodide config list
35+ # Save EMSDK version
36+ EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
37+ echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
38+
39+ - uses : mymindstorm/setup-emsdk@v12
40+ with :
41+ version : ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
42+ actions-cache-folder : emsdk-cache
43+
44+ - name : Build
45+ run : PYODIDE_BUILD_EXPORTS=whole_archive CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build
46+ working-directory : tests
47+
48+ - uses : actions/setup-node@v3
49+ with :
50+ node-version : 18
51+
52+ - name : Set up Pyodide virtual environment
53+ run : |
54+ pyodide venv .venv-pyodide
55+ .venv-pyodide/bin/pip install $(echo -n tests/dist/*.whl)
56+
57+ - name : Test
58+ run : .venv-pyodide/bin/pytest
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ class cpp_function : public function {
222222
223223 /* Dispatch code which converts function arguments and performs the actual function call */
224224 rec->impl = [](function_call &call) -> handle {
225- cast_in args_converter;
225+ cast_in args_converter{} ;
226226
227227 /* Try to cast the function arguments into the C++ domain */
228228 if (!args_converter.load_args (call)) {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ log_cli_level = "info"
3939testpaths = [
4040 " tests" ,
4141]
42- timeout =300
42+ # timeout=300
4343
4444
4545[tool .pylint ]
Original file line number Diff line number Diff line change @@ -88,7 +88,12 @@ set(PYBIND11_TEST_FILTER
8888if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
8989 # We're being loaded directly, i.e. not via add_subdirectory, so make this
9090 # work as its own project and load the pybind11Config to get the tools we need
91- find_package (pybind11 REQUIRED CONFIG)
91+
92+ if (SKBUILD)
93+ add_subdirectory (.. pybind11_src)
94+ else ()
95+ find_package (pybind11 REQUIRED CONFIG)
96+ endif ()
9297endif ()
9398
9499if (NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES )
@@ -488,6 +493,9 @@ foreach(target ${test_targets})
488493 endforeach ()
489494 endif ()
490495 endif ()
496+ if (SKBUILD)
497+ install (TARGETS ${target} LIBRARY DESTINATION .)
498+ endif ()
491499endforeach ()
492500
493501# Provide nice organisation in IDEs
Original file line number Diff line number Diff line change 1+ # Warning: this is currently used for pyodide, and is not a general out-of-tree
2+ # builder for the tests (yet). Specifically, wheels can't be built from SDists.
3+
4+ [build-system ]
5+ requires = [" scikit-build-core[pyproject]" ]
6+ build-backend = " scikit_build_core.build"
7+
8+ [project ]
9+ name = " pybind11_tests"
10+ version = " 0.0.1"
11+ dependencies = [" pytest" , " pytest-timeout" ]
Original file line number Diff line number Diff line change 11import sys
22
3+ import pytest
4+
5+ if sys .platform .startswith ("emscripten" ):
6+ pytest .skip (
7+ "Test not implemented from single wheel on Pyodide" , allow_module_level = True
8+ )
9+
310from widget_module import Widget
411
512
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ import pytest
4+
5+ if sys .platform .startswith ("emscripten" ):
6+ pytest .skip (
7+ "Test not implemented from single wheel on Pyodide" , allow_module_level = True
8+ )
9+
110import trampoline_module
211
312
You can’t perform that action at this time.
0 commit comments