Skip to content

Commit 6d9a396

Browse files
authored
Merge pull request #415 from Distributive-Network/Xmader/chore/wheel-macos-version-support
Make the wheel packages we build also support lower versions of macOS
2 parents 3dc12c7 + 87e7b93 commit 6d9a396

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ jobs:
201201
WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
202202
BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel
203203
ls -lah ./dist/
204+
- name: Make the wheels we build also support lower versions of macOS
205+
if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }}
206+
# Change the platform tag part of the wheel filename to `macosx_11_0_xxx` (means to support macOS 11.0 and above)
207+
# See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format
208+
# 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.
209+
# Otherwise, pip would fallback to compile from the source distribution.
210+
run: |
211+
cd ./dist/
212+
for file in *.whl; do
213+
mv "$file" "$(echo "$file" | sed -E 's/macosx_[0-9]+_[0-9]+/macosx_11_0/')";
214+
done
204215
- name: Upload wheel as CI artifacts
205216
uses: actions/upload-artifact@v3
206217
with:

0 commit comments

Comments
 (0)