Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wheels #51

Merged
merged 28 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
23 changes: 17 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"}]
description = "Efficient and parallelized algorithms for fine point cloud registration"
readme = "README.md"
Expand All @@ -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

Expand All @@ -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
Loading