Skip to content

Commit f28114f

Browse files
committed
fix: improve cross-platform compatibility in wheel building
- Add explicit shell: bash for all steps - Separate macOS wheel repair into a dedicated step - Fix Windows compatibility issues
1 parent f89f0fc commit f28114f

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/build-wheels.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- name: Install build tools
3434
run: |
3535
python -m pip install build poetry
36+
shell: bash
3637

3738
- name: Build wheel with dependencies
3839
run: |
@@ -41,24 +42,26 @@ jobs:
4142
4243
# Build wheel including all dependencies
4344
python -m pip wheel . -w dist/
44-
45-
# On macOS, repair wheels and build for arm64 if needed
46-
if [ "${{ runner.os }}" = "macOS" ]; then
47-
pip install delocate
48-
if [ "${{ matrix.arch }}" = "arm64" ]; then
49-
# Set environment for arm64 build
50-
export ARCHFLAGS="-arch arm64"
51-
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
52-
fi
53-
delocate-wheel -w dist/fixed -v dist/*.whl
54-
mv dist/fixed/* dist/
55-
rm -rf dist/fixed
45+
shell: bash
46+
47+
- name: Repair macOS wheels
48+
if: runner.os == 'macOS'
49+
run: |
50+
pip install delocate
51+
if [ "${{ matrix.arch }}" = "arm64" ]; then
52+
# Set environment for arm64 build
53+
export ARCHFLAGS="-arch arm64"
54+
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
5655
fi
56+
delocate-wheel -w dist/fixed -v dist/*.whl
57+
mv dist/fixed/* dist/
58+
rm -rf dist/fixed
5759
shell: bash
5860

5961
- name: Build source distribution
6062
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
6163
run: python -m build --sdist --outdir dist/
64+
shell: bash
6265

6366
- name: Upload to GitHub Release
6467
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)