From 301fcbea27e208236fc0e63c676f38d46ebe1168 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 23 Aug 2024 20:03:46 +0000 Subject: [PATCH 1/5] 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 --- .github/workflows/test-and-publish.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 6f3521c6..7df7f813 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -208,6 +208,16 @@ jobs: WORKFLOW_BUILD_TYPE=${{ inputs.build_type }} BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel ls -lah ./dist/ + - name: Make the wheels we build also support lower versions of macOS + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }} + # Change the platform tag part of the wheel filename to `macosx_11_xxx` (means to support macOS 11) + # See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format + # 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. + # Otherwise, pip would fallback to compile from the source distribution. + run: | + for file in *.whl; do + mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+/macosx_11/')"; + done - name: Upload wheel as CI artifacts uses: actions/upload-artifact@v3 with: From d6dc01d62e67da9707ba8f28a5f6269dbb511c9b Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 23 Aug 2024 20:11:20 +0000 Subject: [PATCH 2/5] chore: make the wheel packages we build for macOS support macOS 11.0 and above --- .github/workflows/test-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 7df7f813..65211076 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -210,13 +210,13 @@ jobs: ls -lah ./dist/ - name: Make the wheels we build also support lower versions of macOS if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }} - # Change the platform tag part of the wheel filename to `macosx_11_xxx` (means to support macOS 11) + # Change the platform tag part of the wheel filename to `macosx_11_0_xxx` (means to support macOS 11.0 and above) # See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format # 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. # Otherwise, pip would fallback to compile from the source distribution. run: | for file in *.whl; do - mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+/macosx_11/')"; + mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+_[0-9]\+/macosx_11_0/')"; done - name: Upload wheel as CI artifacts uses: actions/upload-artifact@v3 From 80b5111755ea22815863b4842ceb8eab37675d80 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 23 Aug 2024 20:28:47 +0000 Subject: [PATCH 3/5] fix: the wheel package files should be in the `./dist/` directory --- .github/workflows/test-and-publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 65211076..610e89ac 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -215,6 +215,7 @@ jobs: # 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. # Otherwise, pip would fallback to compile from the source distribution. run: | + cd ./dist/ for file in *.whl; do mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+_[0-9]\+/macosx_11_0/')"; done From 4e7596bae42f956652b916a1c2c10ccf86383b52 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 23 Aug 2024 20:30:08 +0000 Subject: [PATCH 4/5] fix: we are building on macOS 12 in the CI --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 610e89ac..fecc55f1 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -209,7 +209,7 @@ jobs: BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel ls -lah ./dist/ - name: Make the wheels we build also support lower versions of macOS - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }} + if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }} # Change the platform tag part of the wheel filename to `macosx_11_0_xxx` (means to support macOS 11.0 and above) # See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format # 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. From ab8ba460d45598c38d025cbc73e07b81e303a3c1 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 23 Aug 2024 20:44:25 +0000 Subject: [PATCH 5/5] fix: `sed` works differently on macOS as it's the BSD variant --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index fecc55f1..1544ba71 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -217,7 +217,7 @@ jobs: run: | cd ./dist/ for file in *.whl; do - mv "$file" "$(echo "$file" | sed 's/macosx_[0-9]\+_[0-9]\+/macosx_11_0/')"; + mv "$file" "$(echo "$file" | sed -E 's/macosx_[0-9]+_[0-9]+/macosx_11_0/')"; done - name: Upload wheel as CI artifacts uses: actions/upload-artifact@v3