From 804f5219881ad2802118c4d81d41961dbbdbb2e6 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 00:56:29 +0900 Subject: [PATCH 1/6] ci: upgrade deprecated GitHub Actions and clean pyproject actions/upload-artifact@v3 and actions/download-artifact@v3 stopped working on 2025-01-30, which is why the PyPI workflow has been failing in 7 seconds on every push. Upgrade all action versions to current releases and adapt pypi.yml to the v4 unique-name requirement. Also drop the dead INCLUDE_PYTHON_WRAPPER cmake.arg (the variable is unused and produces a warning) and pin cmake.version to <4 to insulate the wheel build from CMake 4.x deprecations in transitive deps. - actions/checkout: v3 -> v4 - actions/setup-python: v4 -> v5 - actions/upload-artifact: v3 -> v4 (with explicit names) - actions/download-artifact: v3 -> v4 (pattern + merge-multiple) - pre-commit/action: v3.0.0 -> v3.0.1 - pypa/cibuildwheel: v2.16.5 -> v2.21.3 - drop jwlawson/actions-setup-cmake (runners now ship cmake >= 3.27) --- .github/workflows/cpp.yml | 8 ++------ .github/workflows/pre-commit.yml | 6 +++--- .github/workflows/pypi.yml | 19 +++++++++++-------- .github/workflows/python.yml | 4 ++-- .github/workflows/ros.yml | 6 +----- python/pyproject.toml | 2 +- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index a8ad707..bce8761 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -16,11 +16,7 @@ jobs: matrix: os: [ubuntu-24.04, ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac macos-14, macos-15] steps: - - uses: actions/checkout@v3 - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: "3.25.x" + - uses: actions/checkout@v4 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp/ - name: Build @@ -38,7 +34,7 @@ jobs: os: [ubuntu-24.04, ubuntu-22.04] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 0058454..21c49f6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,8 +11,8 @@ jobs: name: Pre-commit checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e4807b6..818a554 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,15 +14,16 @@ jobs: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build sdist run: pipx run build --sdist ${{github.workspace}}/python/ - name: Move sdist to dist run: mkdir -p dist && mv ${{github.workspace}}/python/dist/*.tar.gz dist/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: sdist path: dist/*.tar.gz cibuildwheel: @@ -33,11 +34,11 @@ jobs: os: [ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac, macos-14] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build test wheels (only PRs) if: github.event_name != 'release' - uses: pypa/cibuildwheel@v2.16.5 + uses: pypa/cibuildwheel@v2.21.3 env: # build 1 build per platform just to make sure we can do it later when releasing CIBW_BUILD: "cp310-*" with: @@ -45,12 +46,13 @@ jobs: - name: Build all wheels if: github.event_name == 'release' - uses: pypa/cibuildwheel@v2.16.5 + uses: pypa/cibuildwheel@v2.21.3 with: package-dir: ${{github.workspace}}/python/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl pypi: @@ -58,10 +60,11 @@ jobs: needs: [cibuildwheel, build_sdist] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact path: dist + pattern: "{sdist,wheels-*}" + merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 5cc1f86..daff49d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,9 +13,9 @@ jobs: os: [ubuntu-24.04, ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac macos-14, macos-15] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/ros.yml b/.github/workflows/ros.yml index 678cf47..e23e2ac 100644 --- a/.github/workflows/ros.yml +++ b/.github/workflows/ros.yml @@ -14,11 +14,7 @@ jobs: release: [humble, jazzy] container: osrf/ros:${{ matrix.release }}-desktop steps: - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: "3.25.x" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run colcon run: source /opt/ros/${{ matrix.release }}/setup.bash && colcon build --event-handlers console_direct+ shell: bash diff --git a/python/pyproject.toml b/python/pyproject.toml index 764d7ac..d847485 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -17,4 +17,4 @@ demo = [ ] [tool.scikit-build] -cmake.args = ["-DINCLUDE_PYTHON_WRAPPER=true"] +cmake.version = ">=3.18,<4" From 3bf45bd7305d9811878a1db08f6d746b05f7e088 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 00:58:06 +0900 Subject: [PATCH 2/6] ci: extend matrix with macOS runners (arm64 + Intel) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cpp/python builds work cleanly on macOS in local testing — the algorithm core only depends on Eigen (FetchContent-bundled) and uses no OpenMP/TBB, so AppleClang is sufficient and no brew toolchain is required. Add macos-14 (Apple Silicon) and macos-13 (Intel) to: - cpp.yml::cpp_api (cpp_api_dev stays Linux-only by design — apt deps) - python.yml::python_package - pypi.yml::cibuildwheel (so release tags publish mac wheels too) fail-fast: false so a flake on one OS doesn't cancel the rest. --- .github/workflows/cpp.yml | 3 ++- .github/workflows/pypi.yml | 3 ++- .github/workflows/python.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index bce8761..f20a86f 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -13,8 +13,9 @@ jobs: cpp_api: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-24.04, ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac macos-14, macos-15] + os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14, macos-13] steps: - uses: actions/checkout@v4 - name: Configure CMake diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 818a554..3b086c8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -30,8 +30,9 @@ jobs: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac, macos-14] + os: [ubuntu-22.04, windows-2022, macos-14, macos-13] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index daff49d..7ac8485 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -9,8 +9,9 @@ jobs: python_package: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-24.04, ubuntu-22.04, windows-2022] # TODO(hlim): Support Mac macos-14, macos-15] + os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14, macos-13] steps: - uses: actions/checkout@v4 From c83af067fd90a922ba02c018efdef45a79d73252 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 00:59:59 +0900 Subject: [PATCH 3/6] build: make Makefile cross-platform (macOS + Linux) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous Makefile assumed GNU coreutils (nproc --all), which fails on macOS. Detect the host OS and route the parallel build count through sysctl on Darwin, nproc elsewhere. Also drop the redundant 'pip install numpy' from the pyinstall target — numpy is already declared in pyproject.toml as a runtime dependency, so pip resolves it automatically. README: add the macOS prerequisite block (brew install cmake) and extend the Tested Environment list to cover macOS 13/14 and Ubuntu 24.04. --- Makefile | 14 +++++++++++--- README.md | 13 ++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96c05a7..8ed1c9e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,14 @@ +UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown) +ifeq ($(UNAME_S),Darwin) + NPROC := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 4) +else + NPROC := $(shell nproc --all 2>/dev/null || echo 4) +endif + +.PHONY: pyinstall pyinstall_with_demo cppinstall cppinstall_with_demo + pyinstall: @python3 -m pip install --upgrade pip - @pip install numpy @pip install --verbose ./python/ pyinstall_with_demo: pyinstall @@ -8,8 +16,8 @@ pyinstall_with_demo: pyinstall cppinstall: @cmake -Bcpp/build cpp/ - @cmake --build cpp/build -j$(nproc --all) + @cmake --build cpp/build -j$(NPROC) cppinstall_with_demo: @cmake -Bcpp/build cpp/ -DINCLUDE_CPP_EXAMPLES=ON - @cmake --build cpp/build -j$(nproc --all) + @cmake --build cpp/build -j$(NPROC) diff --git a/README.md b/README.md index 76fc484..c9ebfb6 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,20 @@ > What we need are just minimal dependencies. +**Ubuntu / Debian:** + ```commandline sudo apt-get install g++ build-essential libeigen3-dev python3-pip python3-dev cmake -y ``` +**macOS** (Apple Silicon or Intel): + +```commandline +brew install cmake +``` + +Eigen is fetched automatically by CMake, so no extra system package is required on macOS. The build works with the bundled AppleClang toolchain. + ## :gear: How to build & Run @@ -124,7 +134,8 @@ In addition, you can also check the paper of our baseline, Patchwork. ([arXiv][p ## :triangular_flag_on_post: Tested Environment -- Ubuntu ~~18.04 and~~ 20.04 and 22.04 +- Ubuntu ~~18.04 and~~ 20.04, 22.04, and 24.04 +- macOS 13 (Intel) and macOS 14+ (Apple Silicon) - CMake 3.25.1 (>=3.20, min. Required to install Open3D) - In `scripts/install_open3d.bash`, the installation of the higher version of CMake is already implemented. - Open3D ~~0.15.2~~ 0.18.0 From fde37a83f9aa3a718916cfa8345339d921bd185b Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 01:01:53 +0900 Subject: [PATCH 4/6] chore: drop dead pybind11.cmake and add a python smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cpp/cmake/pybind11.cmake was never include()'d anywhere — python/ uses find_package(pybind11 CONFIG REQUIRED) directly, and cpp/ does not need pybind11 at all. The pinned v2.2.3 (2018) was just noise. Activate the previously-commented pytest step in python.yml and add two minimal smoke tests under python/tests/: one verifies the imported module exposes the public API, the other runs a real ground estimation against data/000000.bin and asserts the output partitions the input. Wire up a [test] extra in pyproject.toml so the CI step can install pytest with the package in one command. --- .github/workflows/python.yml | 10 ++++------ cpp/cmake/pybind11.cmake | 13 ------------- python/pyproject.toml | 3 +++ python/tests/test_smoke.py | 31 +++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 cpp/cmake/pybind11.cmake create mode 100644 python/tests/test_smoke.py diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7ac8485..ac0d8b6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,9 +22,7 @@ jobs: python -m pip install --upgrade pip - name: Build pip package run: | - python -m pip install --verbose ./python/ - # TODO(hlim) Set unit test - # - name: Run unittests - # run: | - # python -m pip install --verbose './python[test]' - # pytest -rA --verbose ./python/ + python -m pip install --verbose './python[test]' + - name: Run unittests + run: | + pytest -rA --verbose ./python/ diff --git a/cpp/cmake/pybind11.cmake b/cpp/cmake/pybind11.cmake deleted file mode 100644 index c24911d..0000000 --- a/cpp/cmake/pybind11.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include(FetchContent) - -FetchContent_Declare( - pybind11 - GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.2.3 -) - -FetchContent_GetProperties(pybind11) -if(NOT pybind11_POPULATED) - FetchContent_Populate(pybind11) - add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR} EXCLUDE_FROM_ALL) -endif() diff --git a/python/pyproject.toml b/python/pyproject.toml index d847485..b9fd219 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -15,6 +15,9 @@ dependencies = [ demo = [ "open3d-cpu>=0.17" ] +test = [ + "pytest" +] [tool.scikit-build] cmake.version = ">=3.18,<4" diff --git a/python/tests/test_smoke.py b/python/tests/test_smoke.py new file mode 100644 index 0000000..b93c36a --- /dev/null +++ b/python/tests/test_smoke.py @@ -0,0 +1,31 @@ +import os + +import numpy as np +import pypatchworkpp + + +DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "data") + + +def _read_bin(path): + return np.fromfile(path, dtype=np.float32).reshape(-1, 4) + + +def test_module_imports_and_exposes_api(): + assert hasattr(pypatchworkpp, "Parameters") + assert hasattr(pypatchworkpp, "patchworkpp") + + +def test_estimate_ground_partitions_all_points(): + params = pypatchworkpp.Parameters() + pp = pypatchworkpp.patchworkpp(params) + + scan = _read_bin(os.path.join(DATA_DIR, "000000.bin")) + pp.estimateGround(scan) + + ground = pp.getGround() + nonground = pp.getNonground() + + assert ground.shape[0] > 0 + assert nonground.shape[0] > 0 + assert ground.shape[0] + nonground.shape[0] <= scan.shape[0] From 44164418b94ac0ff225ec350fd7603e7b6e222d2 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 01:09:08 +0900 Subject: [PATCH 5/6] style: drop redundant blank line in test_smoke.py for isort --- python/tests/test_smoke.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/tests/test_smoke.py b/python/tests/test_smoke.py index b93c36a..3769ee3 100644 --- a/python/tests/test_smoke.py +++ b/python/tests/test_smoke.py @@ -3,7 +3,6 @@ import numpy as np import pypatchworkpp - DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "data") From c119846aa024f16be578ef5a3a1de35f67ea8f40 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 9 May 2026 09:55:25 +0900 Subject: [PATCH 6/6] ci: drop macos-13 (Intel) from matrix due to runner queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub-hosted macos-13 (Intel) runners have severely limited capacity — jobs sat queued for 1h 43m on the test PR without ever starting. Apple is winding down Intel Mac and runner availability is unlikely to improve. Restrict the macOS coverage to macos-14 (Apple Silicon) so the matrix is reliably green; Intel mac users can still build locally. --- .github/workflows/cpp.yml | 2 +- .github/workflows/pypi.yml | 2 +- .github/workflows/python.yml | 2 +- README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index f20a86f..d38d30c 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14, macos-13] + os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14] steps: - uses: actions/checkout@v4 - name: Configure CMake diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 3b086c8..943650c 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022, macos-14, macos-13] + os: [ubuntu-22.04, windows-2022, macos-14] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ac0d8b6..a661e8e 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14, macos-13] + os: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-14] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index c9ebfb6..4065c2a 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ In addition, you can also check the paper of our baseline, Patchwork. ([arXiv][p ## :triangular_flag_on_post: Tested Environment - Ubuntu ~~18.04 and~~ 20.04, 22.04, and 24.04 -- macOS 13 (Intel) and macOS 14+ (Apple Silicon) +- macOS 14+ (Apple Silicon) - CMake 3.25.1 (>=3.20, min. Required to install Open3D) - In `scripts/install_open3d.bash`, the installation of the higher version of CMake is already implemented. - Open3D ~~0.15.2~~ 0.18.0