Skip to content

Commit

Permalink
cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Apr 15, 2024
1 parent d89cbb6 commit 7690a1e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Wheel

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.17.0

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ endif()

# Python bindings
if(BUILD_PYTHON_BINDINGS)
find_package(Python COMPONENTS Interpreter Development REQUIRED)
find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG REQUIRED)

pybind11_add_module(small_gicp_python src/python/python.cpp)
Expand Down
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authors = [{name = "Kenji Koide", email = "k.koide@aist.go.jp"}]
description = "Efficient and parallelized algorithms for fine point cloud registration"
readme = "README.py.md"
license = {text = "MIT"}
dependencies = ["numpy >=1.21", "scipy >=1.7"]
requires-python = ">=3.7"

[project.urls]
Expand All @@ -29,9 +30,21 @@ wheel.py-api = "cp312" # Build stable ABI wheels for CPython 3.12+
[tool.scikit-build.cmake.define]
BUILD_PYTHON_BINDINGS = true
BUILD_SHARED_LIBS = false
BUILD_WITH_OPENMP = true

[tool.cibuildwheel.linux]
before-all = "yum install -y eigen3-devel libomp-devel"

[tool.cibuildwheel.macos]
before-all = "brew install eigen libomp"

[tool.cibuildwheel.windows]
before-all = "choco install eigen -y"

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux_2_28"
build = "*"
skip = "pp*" # Don't build for PyPy
test-command = "pytest {project}/src --color=yes -v"
test-requires = "pytest"
test-command = "cd {project} && pytest {project}/src/example/*.py --color=yes -v"
build-verbosity = 1

0 comments on commit 7690a1e

Please sign in to comment.