diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..f2d3b92 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,77 @@ +name: Build + +on: + push: + branches: [ master ] + paths-ignore: '**.md' + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-14] + pyver: [cp38, cp39, cp310, cp311, cp312] + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - if: runner.os == 'Windows' + uses: microsoft/setup-msbuild@v2 + + - uses: actions/setup-python@v5 + + - name: Install pytest and cibuildwheel + run: python -m pip install cibuildwheel==2.17.0 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: ${{ matrix.pyver }}-* + CIBW_ARCHS_LINUX: auto aarch64 + # CIBW_ARCHS_LINUX: x86_64 + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://pypi.org/legacy/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f1ece42..52bb2f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(small_gicp VERSION 0.0.1 LANGUAGES C CXX) +project(small_gicp VERSION 0.0.6 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") @@ -51,7 +51,7 @@ if(NOT Eigen3_FOUND) ) add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL) set_target_properties(Eigen3::Eigen PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/Eigen3-src" + INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}" ) endif() @@ -141,7 +141,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 diff --git a/pyproject.toml b/pyproject.toml index 13d9027..9200708 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "small_gicp" -version = "0.0.1" +version = "0.0.6" authors = [{name = "Kenji Koide", email = "k.koide@aist.go.jp"}] description = "Efficient and parallelized algorithms for fine point cloud registration" readme = "README.md" @@ -14,9 +14,6 @@ requires-python = ">=3.7" [project.urls] Homepage = "https://github.com/koide3/small_gicp" -[project.optional-dependencies] -test = ["pytest>=6.0"] - [tool.setuptools] zip_safe = false @@ -31,8 +28,22 @@ BUILD_PYTHON_BINDINGS = true BUILD_HELPER = false BUILD_SHARED_LIBS = false +[tool.cibuildwheel.linux] +before-all = "yum install -y libomp-devel" + +[tool.cibuildwheel.macos] +before-all = "brew install eigen libomp" +environment = { OpenMP_ROOT="/opt/homebrew/opt/libomp" } + +[tool.cibuildwheel.windows] +before-all = "choco install eigen -y" +test-command = "cd /d {project} && pytest {project}/src --color=yes -v" + [tool.cibuildwheel] +manylinux-x86_64-image = "manylinux_2_28" +manylinux-aarch64-image = "manylinux_2_28" build = "*" -skip = "pp*" # Don't build for PyPy -test-command = "pytest {project}/src --color=yes -v" +skip = "pp* *-win32 *_i686 *musllinux*" # Don't build for PyPy, Win32, i686 +test-requires = "pytest numpy scipy" +test-command = "cd {project} && pytest {project}/src --color=yes -v" build-verbosity = 1