Skip to content

Commit

Permalink
Change the way brew python is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored and wantehchang committed Dec 13, 2024
1 parent 260879c commit 03d5e38
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/actions/setup-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ outputs:
runs:
using: "composite"
steps:
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
# Borrowed from https://github.com/mesonbuild/meson/blob/aab2533ab4f7f4c16991620b400d71782f89be1c/.github/workflows/macos.yml#L87-L92
# until https://github.com/actions/setup-python/issues/577 is fixed.
- name: unbreak python in github actions
- name: Force update all brew python
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/2to3*' \
-o -lname '*/Library/Frameworks/Python.framework/idle3*' \
-o -lname '*/Library/Frameworks/Python.framework/pydoc3*' \
-o -lname '*/Library/Frameworks/Python.framework/python3*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
brew update
# GHA messes with links https://github.com/actions/setup-python/issues/577 so we just force replace their installs' with brew's
for pkg in $(brew list --formula | grep -E '^python(@[0-9]+\.[0-9]+)?$'); do
brew upgrade --force --overwrite "$pkg"
done
brew cleanup
shell: bash
- name: Install non-library test dependencies
# imagemagick is used in sh tests (not gtest tests) but we assume that no tests are run by the CI
Expand Down

0 comments on commit 03d5e38

Please sign in to comment.