From 2e6104e9f36fe035d2a323afaf4f37c4ef00cda0 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 6 May 2024 08:54:18 +0200 Subject: [PATCH] Build macos wheels with maximum backwards compatibility --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b750441..f0b21ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,7 +90,9 @@ jobs: env: CIBW_BUILD_VERBOSITY: 1 # add compiled libmagic to the build directory (to include in the wheel) - CIBW_BEFORE_BUILD: bash "add_libmagic.sh" + CIBW_BEFORE_BUILD: ${{ ( startsWith( matrix.os, 'macos' ) && 'sudo -E bash add_libmagic.sh' ) || 'bash add_libmagic.sh' }} + # build macos wheels with maximum backwards compatibility (gcc -mmacosx-version-min flag) + MACOSX_DEPLOYMENT_TARGET: ${{ ( endsWith( matrix.only, 'arm64' ) && '11.0' ) || '10.9' }} # simple smoke test run on each wheel: this is an HLS MP4 video, only recognised in recent versions of libmagic CIBW_TEST_COMMAND: python -c "import magic; assert magic.Magic(mime=True).from_buffer(b'\x00\x00\x00\x1cftypiso5\x00\x00\x00\x01isomiso5hlsf\x00\x00') == 'video/mp4'"