Skip to content

Commit e40d656

Browse files
committed
feat: switch to cibuildwheel
- Use cibuildwheel instead of pip wheel - Configure build through environment variables - Add support for all architectures
1 parent e1f731e commit e40d656

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

.github/workflows/build-wheels.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,17 @@ jobs:
5959
with:
6060
python-version: ${{ matrix.python-version }}
6161

62-
- name: Install build tools
63-
run: |
64-
python -m pip install build poetry
62+
- name: Install cibuildwheel
63+
run: python -m pip install cibuildwheel
6564
shell: bash
6665

67-
- name: Build wheel with dependencies
68-
run: |
69-
# Install dependencies first to ensure they're available
70-
poetry install --all-extras
71-
72-
# Build wheel including all dependencies
73-
python -m pip wheel . -w dist/
74-
shell: bash
75-
76-
- name: Repair macOS wheels
77-
if: runner.os == 'macOS'
78-
run: |
79-
pip install delocate
80-
if [ "${{ matrix.arch }}" = "arm64" ]; then
81-
# Set environment for arm64 build
82-
export ARCHFLAGS="-arch arm64"
83-
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
84-
fi
85-
delocate-wheel -w dist/fixed -v dist/*.whl
86-
mv dist/fixed/* dist/
87-
rm -rf dist/fixed
66+
- name: Build wheels
67+
env:
68+
CIBW_BUILD: cp${{ matrix.python-version }}-*
69+
CIBW_ARCHS: all
70+
CIBW_BEFORE_BUILD: pip install poetry && poetry install --all-extras
71+
CIBW_ENVIRONMENT: INCLUDE_DEPS=1
72+
run: python -m cibuildwheel --output-dir dist
8873
shell: bash
8974

9075
- name: Build source distribution

0 commit comments

Comments
 (0)