Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 39 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,45 +57,61 @@ jobs:
path: dist/*.whl

build-wheels-mypyc:
name: MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
name: Build MyPyC wheels for all platforms
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- os: windows-latest
python-version: "3.9"
- os: macos-13
python-version: "3.13"

runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies with mypyc extras
run: uv sync --extra mypyc --group build
- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Build MyPyC wheel
run: uv build --wheel
- name: Build wheels with cibuildwheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
# Enable mypyc compilation
HATCH_BUILD_HOOKS_ENABLE: "1"
MYPYC_OPT_LEVEL: "3"
MYPYC_DEBUG_LEVEL: "0"
MYPYC_MULTI_FILE: "1"

- name: Upload mypyc wheel artifacts
# Configure cibuildwheel
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' }}-*"
CIBW_BUILD_VERBOSITY: 1

# Platform configuration - comprehensive coverage with QEMU emulation
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64"

# Skip problematic combinations
CIBW_SKIP: "cp39-win_arm64 *-musllinux*"

# Install dependencies using pip for broader compatibility
CIBW_BEFORE_BUILD: "pip install hatch-mypyc hatchling"
CIBW_ENVIRONMENT: "HATCH_BUILD_HOOKS_ENABLE=1 MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 MYPYC_MULTI_FILE=1"

# Test the built wheels
CIBW_TEST_COMMAND: "python -c \"import sqlspec; print('MyPyC wheel test passed')\""

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
name: wheels-mypyc-py${{ matrix.python-version }}
path: wheelhouse/*.whl


test-wheels:
Expand Down Expand Up @@ -127,7 +143,8 @@ jobs:
- name: Download mypyc wheel artifacts
uses: actions/download-artifact@v4
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
pattern: wheels-mypyc-*
merge-multiple: true
path: dist-mypyc/

- name: Test standard wheel installation
Expand Down
64 changes: 41 additions & 23 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,46 +68,63 @@ jobs:
path: dist/*.whl

build-wheels-mypyc:
name: MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
name: Build MyPyC wheels for all platforms
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ${{ github.event.inputs.test_matrix == 'full' && fromJSON('["ubuntu-latest", "windows-latest", "macos-latest", "macos-13"]') || fromJSON('["ubuntu-latest"]') }}
python-version: ${{ github.event.inputs.test_matrix == 'full' && fromJSON('["3.9", "3.10", "3.11", "3.12", "3.13"]') || fromJSON('["3.12"]') }}
exclude:
- os: windows-latest
python-version: "3.9"
- os: macos-13
python-version: "3.13"

runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up QEMU
if: github.event.inputs.test_matrix == 'full'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies with mypyc extras
run: uv sync --extra mypyc --group build
- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Build MyPyC wheel
run: uv build --wheel
- name: Build wheels with cibuildwheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
# Enable mypyc compilation
HATCH_BUILD_HOOKS_ENABLE: "1"
MYPYC_OPT_LEVEL: "3"
MYPYC_DEBUG_LEVEL: "0"
MYPYC_MULTI_FILE: "1"
shell: bash

- name: Upload mypyc wheel artifacts
# Configure cibuildwheel
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' }}-*"
CIBW_BUILD_VERBOSITY: 1

# Platform configuration - conditional ARM64 support with QEMU
CIBW_ARCHS_LINUX: ${{ github.event.inputs.test_matrix == 'full' && 'x86_64 aarch64' || 'x86_64' }}
CIBW_ARCHS_MACOS: ${{ github.event.inputs.test_matrix == 'full' && 'x86_64 arm64' || 'x86_64' }}
CIBW_ARCHS_WINDOWS: "AMD64"

# Skip problematic combinations
CIBW_SKIP: "cp39-win_arm64 *-musllinux*"

# Install dependencies using pip for broader compatibility
CIBW_BEFORE_BUILD: "pip install hatch-mypyc hatchling"
CIBW_ENVIRONMENT: "HATCH_BUILD_HOOKS_ENABLE=1 MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 MYPYC_MULTI_FILE=1"

# Test the built wheels
CIBW_TEST_COMMAND: "python -c \"import sqlspec; print('MyPyC wheel test passed')\""

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
name: wheels-mypyc-py${{ matrix.python-version }}
path: wheelhouse/*.whl


test-wheels:
name: Test ${{ matrix.os }} py${{ matrix.python-version }}
Expand Down Expand Up @@ -138,7 +155,8 @@ jobs:
- name: Download mypyc wheel artifacts
uses: actions/download-artifact@v4
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
pattern: wheels-mypyc-*
merge-multiple: true
path: dist-mypyc/

- name: Test standard wheel installation
Expand Down
Loading