Skip to content

Commit d963abe

Browse files
committed
chore: move to cibuildwheel & add architectures
1 parent 2fe219f commit d963abe

File tree

2 files changed

+66
-63
lines changed

2 files changed

+66
-63
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,54 +57,55 @@ jobs:
5757
path: dist/*.whl
5858

5959
build-wheels-mypyc:
60-
name: MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
60+
name: Build MyPyC wheels for all platforms
61+
runs-on: ubuntu-latest
6162
strategy:
62-
fail-fast: false
6363
matrix:
64-
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
6564
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
66-
exclude:
67-
- os: windows-latest
68-
python-version: "3.9"
69-
- os: macos-13
70-
python-version: "3.13"
71-
72-
runs-on: ${{ matrix.os }}
7365
steps:
7466
- name: Check out repository
7567
uses: actions/checkout@v4
7668

77-
- name: Install uv
78-
uses: astral-sh/setup-uv@v4
79-
80-
- name: Set up Python ${{ matrix.python-version }}
81-
run: uv python install ${{ matrix.python-version }}
69+
- name: Set up Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: ${{ matrix.python-version }}
8273

83-
- name: Install dependencies with mypyc extras
84-
run: uv sync --extra mypyc --group build
74+
- name: Install cibuildwheel
75+
run: python -m pip install cibuildwheel
8576

86-
- name: Build MyPyC wheel
87-
run: uv build --wheel
77+
- name: Build wheels with cibuildwheel
78+
run: python -m cibuildwheel --output-dir wheelhouse
8879
env:
80+
# Enable mypyc compilation
8981
HATCH_BUILD_HOOKS_ENABLE: "1"
9082
MYPYC_OPT_LEVEL: "3"
9183
MYPYC_DEBUG_LEVEL: "0"
9284
MYPYC_MULTI_FILE: "1"
9385

94-
- name: Repair Linux wheels with auditwheel
95-
if: runner.os == 'Linux'
96-
run: |
97-
for wheel in dist/*.whl; do
98-
echo "Repairing $wheel"
99-
uv tool run auditwheel repair "$wheel" -w dist/ --plat manylinux_2_17_x86_64
100-
rm "$wheel"
101-
done
86+
# Configure cibuildwheel
87+
CIBW_BUILD: "cp${{ matrix.python-version }}-*"
88+
CIBW_BUILD_VERBOSITY: 1
89+
90+
# Platform configuration - comprehensive coverage
91+
CIBW_ARCHS_LINUX: "x86_64 aarch64"
92+
CIBW_ARCHS_MACOS: "x86_64 arm64"
93+
CIBW_ARCHS_WINDOWS: "AMD64 ARM64"
94+
95+
# Skip problematic combinations
96+
CIBW_SKIP: "cp39-win_arm64 *-musllinux*"
10297

103-
- name: Upload mypyc wheel artifacts
98+
# Use uv for faster dependency resolution
99+
CIBW_BEFORE_BUILD: "pip install uv && uv sync --extra mypyc --group build"
100+
101+
# Test the built wheels
102+
CIBW_TEST_COMMAND: "python -c \"import sqlspec; print('MyPyC wheel test passed')\""
103+
104+
- name: Upload wheel artifacts
104105
uses: actions/upload-artifact@v4
105106
with:
106-
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
107-
path: dist/*.whl
107+
name: wheels-mypyc-py${{ matrix.python-version }}
108+
path: wheelhouse/*.whl
108109

109110

110111
test-wheels:
@@ -136,7 +137,8 @@ jobs:
136137
- name: Download mypyc wheel artifacts
137138
uses: actions/download-artifact@v4
138139
with:
139-
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
140+
pattern: wheels-mypyc-*
141+
merge-multiple: true
140142
path: dist-mypyc/
141143

142144
- name: Test standard wheel installation

.github/workflows/test-build.yml

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,55 +68,55 @@ jobs:
6868
path: dist/*.whl
6969

7070
build-wheels-mypyc:
71-
name: MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
71+
name: Build MyPyC wheels
72+
runs-on: ubuntu-latest
7273
strategy:
73-
fail-fast: false
7474
matrix:
75-
os: ${{ github.event.inputs.test_matrix == 'full' && fromJSON('["ubuntu-latest", "windows-latest", "macos-latest", "macos-13"]') || fromJSON('["ubuntu-latest"]') }}
7675
python-version: ${{ github.event.inputs.test_matrix == 'full' && fromJSON('["3.9", "3.10", "3.11", "3.12", "3.13"]') || fromJSON('["3.12"]') }}
77-
exclude:
78-
- os: windows-latest
79-
python-version: "3.9"
80-
- os: macos-13
81-
python-version: "3.13"
82-
83-
runs-on: ${{ matrix.os }}
8476
steps:
8577
- name: Check out repository
8678
uses: actions/checkout@v4
8779

88-
- name: Install uv
89-
uses: astral-sh/setup-uv@v4
90-
91-
- name: Set up Python ${{ matrix.python-version }}
92-
run: uv python install ${{ matrix.python-version }}
80+
- name: Set up Python
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: ${{ matrix.python-version }}
9384

94-
- name: Install dependencies with mypyc extras
95-
run: uv sync --extra mypyc --group build
85+
- name: Install cibuildwheel
86+
run: python -m pip install cibuildwheel
9687

97-
- name: Build MyPyC wheel
98-
run: uv build --wheel
88+
- name: Build wheels with cibuildwheel
89+
run: python -m cibuildwheel --output-dir wheelhouse
9990
env:
91+
# Enable mypyc compilation
10092
HATCH_BUILD_HOOKS_ENABLE: "1"
10193
MYPYC_OPT_LEVEL: "3"
10294
MYPYC_DEBUG_LEVEL: "0"
10395
MYPYC_MULTI_FILE: "1"
104-
shell: bash
10596

106-
- name: Repair Linux wheels with auditwheel
107-
if: runner.os == 'Linux'
108-
run: |
109-
for wheel in dist/*.whl; do
110-
echo "Repairing $wheel"
111-
uv tool run auditwheel repair "$wheel" -w dist/ --plat manylinux_2_17_x86_64
112-
rm "$wheel"
113-
done
97+
# Configure cibuildwheel
98+
CIBW_BUILD: "cp${{ matrix.python-version }}-*"
99+
CIBW_BUILD_VERBOSITY: 1
100+
101+
# Platform configuration - limited for testing
102+
CIBW_ARCHS_LINUX: ${{ github.event.inputs.test_matrix == 'full' && '"x86_64 aarch64"' || '"x86_64"' }}
103+
CIBW_ARCHS_MACOS: ${{ github.event.inputs.test_matrix == 'full' && '"x86_64 arm64"' || '"x86_64"' }}
104+
CIBW_ARCHS_WINDOWS: ${{ github.event.inputs.test_matrix == 'full' && '"AMD64"' || '"AMD64"' }}
105+
106+
# Skip problematic combinations
107+
CIBW_SKIP: "cp39-win_arm64 *-musllinux*"
114108

115-
- name: Upload mypyc wheel artifacts
109+
# Use uv for faster dependency resolution
110+
CIBW_BEFORE_BUILD: "pip install uv && uv sync --extra mypyc --group build"
111+
112+
# Test the built wheels
113+
CIBW_TEST_COMMAND: "python -c \"import sqlspec; print('MyPyC wheel test passed')\""
114+
115+
- name: Upload wheel artifacts
116116
uses: actions/upload-artifact@v4
117117
with:
118-
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
119-
path: dist/*.whl
118+
name: wheels-mypyc-py${{ matrix.python-version }}
119+
path: wheelhouse/*.whl
120120

121121
test-wheels:
122122
name: Test ${{ matrix.os }} py${{ matrix.python-version }}
@@ -147,7 +147,8 @@ jobs:
147147
- name: Download mypyc wheel artifacts
148148
uses: actions/download-artifact@v4
149149
with:
150-
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
150+
pattern: wheels-mypyc-*
151+
merge-multiple: true
151152
path: dist-mypyc/
152153

153154
- name: Test standard wheel installation

0 commit comments

Comments
 (0)