diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml new file mode 100644 index 0000000..35aeac4 --- /dev/null +++ b/.github/workflows/wheel.yml @@ -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 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 8081988..4cd948b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 4994122..7f3823f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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