Skip to content

Commit

Permalink
Enforce Homebrew Python on Intel macOS runners
Browse files Browse the repository at this point in the history
It appears that GitHub runners come with an extra "framework" Python
symlinked into /usr/local. On arm64 runners this has no effect, since
the Homebrew prefix has changed to /opt/homebrew. On x86_64 runners,
however, Homebrew still lives in /usr/local and this is probably why
CMake can't find the right Python.

Try the minimum workaround first.
  • Loading branch information
ludwigschwardt committed Jul 1, 2024
1 parent ed4f292 commit 2ad579b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ jobs:
continue-on-error: true

steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4
with:
# Needed for `setuptools-scm`
fetch-depth: 0

- name: install homebrew packages
# See https://github.com/orgs/Homebrew/discussions/3895#discussioncomment-4130560
- name: Ensure we use Homebrew Python
run: find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete

- name: Install Homebrew packages
run: |
brew tap casacore/tap
brew install casacore
- name: make virtualenv
- name: Make virtualenv
# XXX Use Homebrew's numpy to be safe for now, especially since
# PyPI is now on numpy 2.0, which complicates matters
run: python3 -m venv venv --system-site-packages
Expand All @@ -43,7 +47,7 @@ jobs:
- name: Run pytest
run: cd tests && ../venv/bin/pytest

- name: make binary wheel
- name: Make binary wheel
run: venv/bin/pip wheel -w dist .

- name: Delocate binary wheel
Expand Down

0 comments on commit 2ad579b

Please sign in to comment.