Mentions légales du service

Skip to content
Snippets Groups Projects
Unverified Commit 32da0259 authored by Henry Schreiner's avatar Henry Schreiner Committed by GitHub
Browse files

ci: add pyodide test (#84)


* ci: add pyodide test

Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>

* WIP: fix pyodide

Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>

* fix: specify test location

Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>

* WIP: try printing wheel contents

Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update pyproject.toml

* Update enscripten.yaml

* style: pre-commit fixes

* Update CMakeLists.txt

---------

Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent f624a7bc
No related branches found
No related tags found
No related merge requests found
name: WASM
on:
workflow_dispatch:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wasm-emscripten:
name: Pyodide
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pyodide-build
run: pip install pyodide-build==0.23.1
- name: Compute emsdk version
id: compute-emsdk-version
run: |
pyodide xbuildenv install --download
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
actions-cache-folder: emsdk-cache
# A future version of pyodide may switch to -fwasm-exceptions
- name: Build
run: CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build
- uses: actions/upload-artifact@v3
with:
path: dist/*.whl
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up Pyodide virtual environment
run: |
pyodide venv .venv-pyodide
.venv-pyodide/bin/pip install $(echo -n dist/*.whl)[test]
- name: Test
run: .venv-pyodide/bin/pytest
......@@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.15...3.26)
project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION})
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(_core MODULE src/main.cpp)
python_add_library(_core MODULE src/main.cpp WITH_SOABI)
target_link_libraries(_core PRIVATE pybind11::headers)
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION})
install(TARGETS _core DESTINATION scikit_build_example)
[build-system]
requires = ["scikit-build-core>=0.2.1", "pybind11"]
requires = ["scikit-build-core>=0.3.3", "pybind11"]
build-backend = "scikit_build_core.build"
......@@ -31,6 +31,14 @@ test = ["pytest"]
wheel.expand-macos-universal-tags = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
testpaths = ["tests"]
[tool.cibuildwheel]
test-command = "pytest {project}/tests"
test-extras = ["test"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment