Skip to content

v0.21.0

v0.21.0 #37

Workflow file for this run

name: Latest Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-source:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra performance --group build
- name: Build source distribution
run: uv build --sdist
- name: Upload source artifacts
uses: actions/upload-artifact@v4
with:
name: source-dist
path: dist/*.tar.gz
build-wheels-standard:
name: Build standard pure Python wheel
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra performance --group build
- name: Build standard wheel
run: uv build --wheel
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-standard
path: dist/*.whl
build-wheels-mypyc:
name: Build MyPyC wheels for all platforms
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- 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"
# 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-py${{ matrix.python-version }}
path: wheelhouse/*.whl
test-wheels:
name: Test ${{ matrix.os }} py${{ matrix.python-version }}
needs: [build-wheels-standard, build-wheels-mypyc]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.12"]
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 Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Download standard wheel artifacts
uses: actions/download-artifact@v4
with:
name: wheels-standard
path: dist-standard/
- name: Download mypyc wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-mypyc-*
merge-multiple: true
path: dist-mypyc/
- name: Test standard wheel installation
run: |
uv venv test-standard --python ${{ matrix.python-version }}
uv pip install --python test-standard --find-links dist-standard/ sqlspec
uv run --python test-standard python -c "import sqlspec; print('Standard wheel OK')"
- name: Test mypyc wheel installation
run: |
uv venv test-mypyc --python ${{ matrix.python-version }}
uv pip install --python test-mypyc --find-links dist-mypyc/ sqlspec
uv run --python test-mypyc python -c "import sqlspec; print('MyPyC wheel OK')"
publish-release:
name: Publish to PyPI
needs: [build-source, build-wheels-standard, build-wheels-mypyc, test-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/sqlspec/
steps:
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: "*"
merge-multiple: true
path: dist/
- name: List all built packages
run: |
echo "=== All built packages ==="
find dist/ -name "*.whl" -o -name "*.tar.gz" | sort
echo "=== Package count ==="
find dist/ -name "*.whl" | wc -l
find dist/ -name "*.tar.gz" | wc -l
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
verbose: true
print-hash: true