Skip to content

chore(python): Fix wheel builds and backward compatibility in preparation 0.2 #16

chore(python): Fix wheel builds and backward compatibility in preparation 0.2

chore(python): Fix wheel builds and backward compatibility in preparation 0.2 #16

Workflow file for this run

name: Build Python Wheels
# Build wheels only on a release branch or when requested since it's expensive
on:
workflow_dispatch:
inputs:
version:
description: "Version to force on wheels"
required: false
type: string
default: ""
pull_request:
branches:
- main
paths:
- '.github/workflows/python-wheels.yaml'
push:
branches:
- main
- 'maint-**'
jobs:
sdist:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install packaging tools
run: |
pip install build twine
- name: Build sdist
run: |
cd python/geoarrow-c
python -m build --sdist
- name: Check install from sdist
run: |
pip install python/dist/geoarrow-c-*.tar.gz
- name: Test import
run: |
python -c "import geoarrow.c; print(geoarrow.c.__version__)"
- name: Run twine check
run: |
twine check --strict python/geoarrow-c/dist/*
- uses: actions/upload-artifact@v4
with:
name: release-sdist
path: ./python/geoarrow-c/dist/geoarrow-c-*.tar.gz
wheels:
needs: ["sdist"]
name: ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: "ubuntu-20.04", label: "pyodide", platform: "pyodide", arch: "auto"}
- {os: "ubuntu-20.04", label: "linux", platform: "auto", arch: "auto"}
- {os: "windows-2019", label: "windows", platform: "auto", arch: "auto"}
- {os: "macOS-13", label: "macOS", platform: "auto", arch: "auto"}
- {os: "macOS-14", label: "macOS-arm64", platform: "auto", arch: "auto"}
- {os: "ubuntu-24.04-arm", label: "linux-arm64", platform: "auto", arch: "auto"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.1
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse python/geoarrow-c
env:
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests -vv
CIBW_PLATFORM: ${{ matrix.config.platform }}
CIBW_ARCHS: ${{ matrix.config.arch }}
- uses: actions/upload-artifact@v4
with:
name: release-wheels-${{ matrix.config.label }}
path: ./wheelhouse/*.whl