@@ -68,46 +68,63 @@ jobs:
6868 path : dist/*.whl
6969
7070 build-wheels-mypyc :
71- name : MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
71+ name : Build MyPyC wheels for all platforms
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
80+ - name : Set up QEMU
81+ if : github.event.inputs.test_matrix == 'full'
82+ uses : docker/setup-qemu-action@v3
83+ with :
84+ platforms : all
9085
91- - name : Set up Python ${{ matrix.python-version }}
92- run : uv python install ${{ matrix.python-version }}
86+ - name : Set up Python
87+ uses : actions/setup-python@v5
88+ with :
89+ python-version : " 3.12"
9390
94- - name : Install dependencies with mypyc extras
95- run : uv sync --extra mypyc --group build
91+ - name : Install cibuildwheel
92+ run : python -m pip install cibuildwheel
9693
97- - name : Build MyPyC wheel
98- run : uv build --wheel
94+ - name : Build wheels with cibuildwheel
95+ run : python -m cibuildwheel --output-dir wheelhouse
9996 env :
97+ # Enable mypyc compilation
10098 HATCH_BUILD_HOOKS_ENABLE : " 1"
10199 MYPYC_OPT_LEVEL : " 3"
102100 MYPYC_DEBUG_LEVEL : " 0"
103101 MYPYC_MULTI_FILE : " 1"
104- shell : bash
105102
106- - name : Upload mypyc wheel artifacts
103+ # Configure cibuildwheel
104+ CIBW_BUILD : " cp${{ matrix.python-version == '3.9' && '39' || matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' || matrix.python-version == '3.13' && '313' }}-*"
105+ CIBW_BUILD_VERBOSITY : 1
106+
107+ # Platform configuration - conditional ARM64 support with QEMU
108+ CIBW_ARCHS_LINUX : ${{ github.event.inputs.test_matrix == 'full' && 'x86_64 aarch64' || 'x86_64' }}
109+ CIBW_ARCHS_MACOS : ${{ github.event.inputs.test_matrix == 'full' && 'x86_64 arm64' || 'x86_64' }}
110+ CIBW_ARCHS_WINDOWS : " AMD64"
111+
112+ # Skip problematic combinations
113+ CIBW_SKIP : " cp39-win_arm64 *-musllinux*"
114+
115+ # Install dependencies using pip for broader compatibility
116+ CIBW_BEFORE_BUILD : " pip install hatch-mypyc hatchling"
117+ CIBW_ENVIRONMENT : " HATCH_BUILD_HOOKS_ENABLE=1 MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 MYPYC_MULTI_FILE=1"
118+
119+ # Test the built wheels
120+ CIBW_TEST_COMMAND : " python -c \" import sqlspec; print('MyPyC wheel test passed')\" "
121+
122+ - name : Upload wheel artifacts
107123 uses : actions/upload-artifact@v4
108124 with :
109- name : wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
110- path : dist/*.whl
125+ name : wheels-mypyc-py${{ matrix.python-version }}
126+ path : wheelhouse/*.whl
127+
111128
112129 test-wheels :
113130 name : Test ${{ matrix.os }} py${{ matrix.python-version }}
@@ -138,7 +155,8 @@ jobs:
138155 - name : Download mypyc wheel artifacts
139156 uses : actions/download-artifact@v4
140157 with :
141- name : wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
158+ pattern : wheels-mypyc-*
159+ merge-multiple : true
142160 path : dist-mypyc/
143161
144162 - name : Test standard wheel installation
0 commit comments