Skip to content

ci: modernize build, add macOS support, and enable python tests#78

Merged
LimHyungTae merged 6 commits into
masterfrom
ci/build-modernization
May 9, 2026
Merged

ci: modernize build, add macOS support, and enable python tests#78
LimHyungTae merged 6 commits into
masterfrom
ci/build-modernization

Conversation

@LimHyungTae
Copy link
Copy Markdown
Member

Summary

Modernizes the build/CI surface so the repo is green again and works on macOS. Bundled as one PR per the maintainer's request, but each commit is independently reviewable and can be cherry-picked.

The PyPI workflow has been failing in 7 seconds on every push since 2025-01-30 because GitHub deprecated actions/upload-artifact@v3. This PR fixes that, and also closes out the long-standing # TODO(hlim): Support Mac comments in the workflows.

Commits

  1. ci: upgrade deprecated GitHub Actions and clean pyproject — bumps checkout/setup-python/upload-artifact/download-artifact/cibuildwheel/pre-commit to current versions, adapts pypi.yml to v4's unique-name requirement, drops dead INCLUDE_PYTHON_WRAPPER cmake.arg, pins cmake.version<4 for the wheel build.
  2. ci: extend matrix with macOS runners (arm64 + Intel) — adds macos-14 and macos-13 to cpp_api, python_package, and cibuildwheel jobs. The algorithm core only depends on Eigen (FetchContent-bundled) and uses no OpenMP/TBB, so AppleClang is sufficient and no brew toolchain is required.
  3. build: make Makefile cross-platform (macOS + Linux)nproc --all doesn't exist on macOS; route the parallel-build count through sysctl on Darwin. Drop the redundant pip install numpy (pyproject already declares it). Add a macOS prerequisite block to the README.
  4. chore: drop dead pybind11.cmake and add a python smoke testcpp/cmake/pybind11.cmake was never include()'d; the v2.2.3 (2018) pin was just noise. Adds two minimal pytest smoke tests (test_smoke.py) covering API exposure and a real ground-estimation run against data/000000.bin, and activates the previously-commented pytest step in python.yml.

Test plan

  • make cppinstall succeeds on macOS arm64 (AppleClang 17, CMake 3.31)
  • pip install ./python produces a working pypatchworkpp wheel on macOS arm64 (Python 3.12)
  • pip install './python[test]' && pytest python/ — 2 tests pass
  • CI matrix passes on Ubuntu 22.04, 24.04, Windows 2022, macOS 14, macOS 13 (verified by this PR's own CI run)

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)
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.
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.
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-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.
@LimHyungTae LimHyungTae force-pushed the ci/build-modernization branch from a2a3890 to c119846 Compare May 9, 2026 01:29
@LimHyungTae LimHyungTae merged commit 306da05 into master May 9, 2026
18 checks passed
@LimHyungTae LimHyungTae deleted the ci/build-modernization branch May 9, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant