Skip to content

Commit 7cdfc90

Browse files
ElektrikAkarclaude
andcommitted
Fix CI wheels: STABLE_ABI conditional, ADTW param order, macOS deployment target
- python/CMakeLists.txt: STABLE_ABI only for Python >= 3.12 (was failing unconditionally on cp39/cp310/cp311) - _dtwcpp_core.cpp: fix adtwBanded call — pass (x, y, band, penalty) not (x, y, penalty, band) to match the C++ signature after ADTW revert - python-wheels.yml: set MACOSX_DEPLOYMENT_TARGET=10.15 for std::filesystem Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 72be95c commit 7cdfc90

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/python-wheels.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@ jobs:
2222

2323
- uses: pypa/cibuildwheel@v2.21
2424
env:
25-
# Build for Python 3.9-3.13; nanobind STABLE_ABI means fewer wheels
25+
# Build for Python 3.9-3.13
26+
# STABLE_ABI (Python >= 3.12) handled conditionally in python/CMakeLists.txt
2627
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
2728
CIBW_SKIP: "*-musllinux_* *-win32 *-manylinux_i686"
2829
CIBW_ARCHS_MACOS: "x86_64 arm64"
2930

3031
# Disable commercial/heavy solvers for wheel builds.
31-
# Each cmake arg must be a separate config-setting line for scikit-build-core.
3232
CIBW_CONFIG_SETTINGS: >-
3333
cmake.args=-DDTWC_BUILD_PYTHON=ON
3434
cmake.args=-DDTWC_ENABLE_GUROBI=OFF
3535
cmake.args=-DDTWC_ENABLE_HIGHS=OFF
3636
37-
# macOS needs libomp for OpenMP
37+
# macOS: require 10.15+ for std::filesystem, provide OpenMP hints
38+
CIBW_ENVIRONMENT_MACOS: >-
39+
MACOSX_DEPLOYMENT_TARGET=10.15
3840
CIBW_BEFORE_BUILD_MACOS: "brew install libomp || true"
3941

4042
# Test the built wheel

python/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
cmake_minimum_required(VERSION 3.21)
22

3-
nanobind_add_module(_dtwcpp_core
4-
STABLE_ABI
5-
src/_dtwcpp_core.cpp
6-
)
3+
# STABLE_ABI requires Python >= 3.12
4+
if(Python_VERSION VERSION_GREATER_EQUAL "3.12")
5+
nanobind_add_module(_dtwcpp_core STABLE_ABI src/_dtwcpp_core.cpp)
6+
else()
7+
nanobind_add_module(_dtwcpp_core src/_dtwcpp_core.cpp)
8+
endif()
79

810
target_link_libraries(_dtwcpp_core PRIVATE dtwc++)
911

python/src/_dtwcpp_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ NB_MODULE(_dtwcpp_core, m) {
152152
const std::vector<double> &y,
153153
int band, double penalty) {
154154
nb::gil_scoped_release release;
155-
return dtwc::adtwBanded<double>(x, y, penalty, band);
155+
return dtwc::adtwBanded<double>(x, y, band, penalty);
156156
}, "x"_a, "y"_a, "band"_a = -1, "penalty"_a = 1.0,
157157
"Compute Amerced DTW distance with non-diagonal step penalty.");
158158

0 commit comments

Comments
 (0)