Skip to content

Commit 2e6104e

Browse files
committed
Build macos wheels with maximum backwards compatibility
1 parent f7bbb03 commit 2e6104e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ jobs:
9090
env:
9191
CIBW_BUILD_VERBOSITY: 1
9292
# add compiled libmagic to the build directory (to include in the wheel)
93-
CIBW_BEFORE_BUILD: bash "add_libmagic.sh"
93+
CIBW_BEFORE_BUILD: ${{ ( startsWith( matrix.os, 'macos' ) && 'sudo -E bash add_libmagic.sh' ) || 'bash add_libmagic.sh' }}
94+
# build macos wheels with maximum backwards compatibility (gcc -mmacosx-version-min flag)
95+
MACOSX_DEPLOYMENT_TARGET: ${{ ( endsWith( matrix.only, 'arm64' ) && '11.0' ) || '10.9' }}
9496
# simple smoke test run on each wheel: this is an HLS MP4 video, only recognised in recent versions of libmagic
9597
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'"
9698

0 commit comments

Comments
 (0)