From 8a172d62411ca4e1ee634d3bbda20e51b9bf3d5f Mon Sep 17 00:00:00 2001 From: Louis Fruleux Date: Fri, 1 Aug 2025 09:44:08 +0200 Subject: [PATCH 1/2] do not setup python --- .github/workflows/publish-pypi.yml | 15 +++++++-------- CI/github/build_wheels.sh | 21 --------------------- 2 files changed, 7 insertions(+), 29 deletions(-) delete mode 100755 CI/github/build_wheels.sh diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index b5db15e..513a80f 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -103,7 +103,6 @@ jobs: platform_id: macosx_x86_64 deployment_target: 13.0 - # MacOS ARM - os: macos-14 python: 310 @@ -138,12 +137,14 @@ jobs: - name: Checkout CPT uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' + - name: macOS OpenMP setup + if: runner.os == 'macOS' + run: bash CI/github/setup_macos_runner.sh - - name: Build and test wheels + - name: Build wheels + uses: pypa/cibuildwheel@v3.1.2 + with: + output-dir: wheelhouse env: CIBW_BEFORE_BUILD: "python -m pip install --upgrade pip" CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} @@ -157,8 +158,6 @@ jobs: CIBW_ENVIRONMENT_MACOS: ${{ format('MACOSX_DEPLOYMENT_TARGET={0}', matrix.deployment_target) }} CIBW_ENABLE: cpython-freethreading - run: bash CI/github/build_wheels.sh - - name: Store artifacts uses: actions/upload-artifact@v4 with: diff --git a/CI/github/build_wheels.sh b/CI/github/build_wheels.sh deleted file mode 100755 index 695ddfa..0000000 --- a/CI/github/build_wheels.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e -set -x - -# OpenMP is not present on macOS by default -if [[ "$RUNNER_OS" == "macOS" ]]; then - echo "Installing Mac OS dependencies" - brew_prefix=$(brew --prefix) - brew install libomp - export CC=/usr/bin/clang - export CXX=/usr/bin/clang++ - export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp" - export CFLAGS="$CFLAGS -I$brew_prefix/opt/libomp/include" - export CXXFLAGS="$CXXFLAGS -I$brew_prefix/opt/libomp/include" - export LDFLAGS="$LDFLAGS -Wl,-rpath,$brew_prefix/opt/libomp/lib -L$brew_prefix/opt/libomp/lib -lomp" -fi - -python -m pip install cibuildwheel==3.1.1 -python -m cibuildwheel --print-build-identifiers -python -m cibuildwheel --output-dir wheelhouse From 9049f18afc112d9c01e9028a4dc23fea2d07b53d Mon Sep 17 00:00:00 2001 From: Louis Fruleux Date: Fri, 1 Aug 2025 09:47:13 +0200 Subject: [PATCH 2/2] add missing file --- CI/github/setup_macos_runner.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 CI/github/setup_macos_runner.sh diff --git a/CI/github/setup_macos_runner.sh b/CI/github/setup_macos_runner.sh new file mode 100644 index 0000000..cdc8da7 --- /dev/null +++ b/CI/github/setup_macos_runner.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e +set -x + +# OpenMP is not present on macOS by default +if [[ "$RUNNER_OS" == "macOS" ]]; then # this if is useless, but better be safe + echo "Installing Mac OS dependencies" + brew_prefix=$(brew --prefix) + brew install libomp + export CC=/usr/bin/clang + export CXX=/usr/bin/clang++ + export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp" + export CFLAGS="$CFLAGS -I$brew_prefix/opt/libomp/include" + export CXXFLAGS="$CXXFLAGS -I$brew_prefix/opt/libomp/include" + export LDFLAGS="$LDFLAGS -Wl,-rpath,$brew_prefix/opt/libomp/lib -L$brew_prefix/opt/libomp/lib -lomp" +fi