Skip to content

Commit

Permalink
ci: migrate macos arm wheels to mac-14, abandon openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarrison committed May 14, 2024
1 parent d434760 commit 682b3eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 64 deletions.
72 changes: 9 additions & 63 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build

on: [push, pull_request]
on: [pull_request] # TODO: only on tags

jobs:
build_wheels:
Expand All @@ -10,30 +10,26 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: "linux-target-x86_64"
- os: macos-13
label: "macos-target-x86_64"
- label: "linux-target-x86_64"
os: ubuntu-latest
- label: "macos-target-x86_64"
os: macos-13
env:
MACOSX_DEPLOYMENT_TARGET: "10.15"
CIBW_ARCHS_MACOS: "x86_64"
- os: macos-13
- os: macos-14
label: "macos-target-arm64"
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
CIBW_ARCHS_MACOS: "arm64"
CC: "Clang"
CXX: "Clang++"
CMAKE_ARGS: "-DNIFTY_LS_OPENMP=OFF"

env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.env.MACOSX_DEPLOYMENT_TARGET }}
CIBW_ARCHS_MACOS: ${{ matrix.env.CIBW_ARCHS_MACOS }}
CC: ${{ matrix.env.CC }}
CXX: ${{ matrix.env.CXX }}
CIBW_CONFIG_SETTINGS: "cmake.verbose=true"
CIBW_BUILD_VERBOSITY: 1
OMP_DISPLAY_ENV: "true"

CMAKE_ARGS: ${{ matrix.env.CMAKE_ARGS }}

steps:
- uses: actions/checkout@v4
Expand All @@ -48,19 +44,6 @@ jobs:
echo "LDFLAGS=$LDFLAGS -L$prefix/lib" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -I$prefix/include" >> $GITHUB_ENV
- name: Set OpenMP env for macos arm64
if: matrix.label == 'macos-target-arm64'
run: |
# pkg=$(brew fetch --force --bottle-tag=arm64_ventura [email protected] | grep 'Downloaded to' | cut -d' ' -f3)
# brew install $pkg
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/4da6acd9348624f2957d841a2d8a75018021778e/Formula/lib/libomp.rb
brew install -s ./libomp.rb
prefix=$(brew --prefix libomp)
echo "LDFLAGS=$LDFLAGS -L$prefix/lib -lomp" >> $GITHUB_ENV
# echo "CXXFLAGS=$CXXFLAGS -I$prefix/include -target arm64-apple-macos11 -Xpreprocessor -fopenmp" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -I$prefix/include -target arm64-apple-macos11" >> $GITHUB_ENV
echo "CMAKE_ARGS=$CMAKE_ARGS -DOpenMP_CXX_INCLUDE_DIR=$prefix/include" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/[email protected]

Expand Down Expand Up @@ -93,45 +76,8 @@ jobs:
name: cibw-sdist
path: dist/*.tar.gz

test_arm64_wheels:
needs: [build_wheels]
runs-on: macos-14
env:
OMP_DISPLAY_ENV: "true"
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}


- uses: actions/download-artifact@v4
with:
name: cibw-wheels-macos-target-arm64
path: wheelhouse/

- name: Install arm64 wheels
run: |
pip install -U pip
pip install -f wheelhouse/ nifty-ls[test]
# ensure that the previous install didn't resolve to PyPI
pip install --no-index -f wheelhouse/ nifty-ls[test]
- name: Run tests
run: |
pytest -s --benchmark-skip tests/
upload_all:
needs: [build_wheels, make_sdist, test_arm64_wheels]
needs: [build_wheels, make_sdist]
environment: pypi

permissions:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ docstring-code-format = true
archs = "auto64"
test-command = "pytest -s --benchmark-skip {project}/tests"
test-extras = "test"
test-skip = "*-macosx_arm64" # cross-compilation
skip = "pp* *-musllinux_*"

[tool.cibuildwheel.linux]
Expand Down

0 comments on commit 682b3eb

Please sign in to comment.