Skip to content

Commit 301fcbe

Browse files
committed
chore: make the wheel packages we build also support lower versions of macOS, otherwise pip would fallback to compile from source
Change the platform tag part of the wheel filename to `macosx_11_xxx` (means to support macOS 11). A wheel package file will only be selected by pip to install if the platform tag satisfies, regardless of whether the binary compatibility actually is. See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format
1 parent c2de958 commit 301fcbe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/test-and-publish.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ jobs:
208208
WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
209209
BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel
210210
ls -lah ./dist/
211+
- name: Make the wheels we build also support lower versions of macOS
212+
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }}
213+
# Change the platform tag part of the wheel filename to `macosx_11_xxx` (means to support macOS 11)
214+
# See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format
215+
# A wheel package file will only be selected by pip to install if the platform tag satisfies, regardless of whether the binary compatibility actually is.
216+
# Otherwise, pip would fallback to compile from the source distribution.
217+
run: |
218+
for file in *.whl; do
219+
mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+/macosx_11/')";
220+
done
211221
- name: Upload wheel as CI artifacts
212222
uses: actions/upload-artifact@v3
213223
with:

0 commit comments

Comments
 (0)