From c936df45fc4e0ad7840dbc8c3bddce10553eecda Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 31 Jan 2024 13:34:04 -0800 Subject: [PATCH] Fix find Python3 logic and macOS workflow (#1367) * macos workflow: use brew --prefix, not /usr/local * macos workflow: set Python3_EXECUTABLE cmake var Signed-off-by: Steve Peters --- .github/workflows/macos.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cc1e55e2f..41e899993 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,11 +18,11 @@ jobs: # Workaround for https://github.com/actions/setup-python/issues/577 - name: Clean up python binaries run: | - rm -f /usr/local/bin/2to3*; - rm -f /usr/local/bin/idle3*; - rm -f /usr/local/bin/pydoc3*; - rm -f /usr/local/bin/python3*; - rm -f /usr/local/bin/python3*-config; + rm -f $(brew --prefix)/bin/2to3*; + rm -f $(brew --prefix)/bin/idle3*; + rm -f $(brew --prefix)/bin/pydoc3*; + rm -f $(brew --prefix)/bin/python3*; + rm -f $(brew --prefix)/bin/python3*-config; - name: Install base dependencies env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 @@ -33,7 +33,9 @@ jobs: - run: mkdir build - name: cmake working-directory: build - run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD + run: | + export PYTHONPATH=$PYTHONPATH:$(brew --prefix)/lib/python + cmake .. -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar/${PACKAGE}/HEAD -DPython3_EXECUTABLE=$(brew --prefix)/bin/python3 - run: make working-directory: build - run: make test