From 2722564d497e1bbd4f3fcef92402ee95b49bcf5f Mon Sep 17 00:00:00 2001 From: Spotlight Date: Fri, 17 May 2024 10:42:18 -0400 Subject: [PATCH] Enforce universal2 Python --- scripts/macos-universal2/build.sh | 8 ++++++++ scripts/macos-universal2/prep-PyQt.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/macos-universal2/build.sh b/scripts/macos-universal2/build.sh index 74079ea..9573161 100755 --- a/scripts/macos-universal2/build.sh +++ b/scripts/macos-universal2/build.sh @@ -4,6 +4,14 @@ set -e # Run everything relative to our script directory. cd "$(dirname "$0")" +# Within GitHub Actions and similar, we should use the Python.org +# copy of Python 3.11 available. This permits a universal2 framework for py2app. +# (Otherwise, GitHub's default runners include a single architecture version.) +if [[ "$CI" == "true" ]]; then + shopt -s expand_aliases + alias python3=/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 +fi + # Activate a virtual environment so we don't pollute the system environment. python3 -m venv --upgrade-deps venv source venv/bin/activate diff --git a/scripts/macos-universal2/prep-PyQt.sh b/scripts/macos-universal2/prep-PyQt.sh index 0168c83..12a271d 100644 --- a/scripts/macos-universal2/prep-PyQt.sh +++ b/scripts/macos-universal2/prep-PyQt.sh @@ -4,6 +4,14 @@ set -e # Provided by @spotlightishere on Github # https://github.com/MCMi460/NSO-RPC/pull/86#issuecomment-1605700512 +# Within GitHub Actions and similar, we should use the Python.org +# copy of Python 3.11 available. This permits a universal2 framework for py2app. +# (Otherwise, GitHub's default runners include a single architecture version.) +if [[ "$CI" == "true" ]]; then + shopt -s expand_aliases + alias python3=/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 +fi + # If we already have a universal2 wheel available, install and process no further. # https://stackoverflow.com/a/6364244 if compgen -G "./PyQt6_*universal2.whl"; then