Skip to content

Bump package to 0.11.31 #47

Bump package to 0.11.31

Bump package to 0.11.31 #47

Workflow file for this run

# Build platform wheels for doltlite. Each wheel bundles a libdoltlite
# built from source by scripts/build-libdoltlite.sh.
#
# Triggers:
# - push to main, PRs: build only (validate)
# - tag `v*`: build + publish to PyPI via trusted publisher
# - manual workflow_dispatch: build only
#
# One-time PyPI setup (see RELEASING.md):
# 1. Create the `doltlite` project on PyPI by uploading the first wheel
# manually OR by configuring a "pending" trusted publisher.
# 2. At https://pypi.org/manage/account/publishing/ add a trusted
# publisher with owner=dolthub, repo=doltlite-python,
# workflow=wheels.yml, environment=pypi.
name: wheels
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
jobs:
build_wheels:
name: ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: macos-14, arch: arm64, cibw_archs: arm64 }
- { os: ubuntu-latest, arch: x86_64, cibw_archs: x86_64 }
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_archs: aarch64 }
# Intel Mac (macos-13) intentionally omitted: GitHub's free-tier
# macos-13 runners queue for 1+ hours, blocking releases. Intel
# Mac users can build from source via `pip install --no-binary
# doltlite doltlite` (with libdoltlite available locally). Bring
# this row back when GitHub's scheduling improves or we move to
# paid/self-hosted runners.
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.21
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
# Wheel content is identical across CPython versions (py3-none
# tag, see setup.py), so build for one Python and the resulting
# wheel covers them all.
CIBW_BUILD: "cp312-*"
# macOS: skip delocate. Our wheel ships libdoltlite as package
# data loaded via absolute path; delocate has nothing useful to
# do, and rewriting libdoltlite's install_name could collide
# with the loader's runtime shim. The default macosx_*_<arch>
# tag setuptools picks is already PyPI-acceptable.
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
# Linux: keep the default auditwheel repair. We don't need it
# to bundle deps (libdoltlite only links libc / libpthread),
# but auditwheel also renames bare `linux_*` tags to the
# appropriate `manylinux_*_<arch>` — which PyPI requires.
# Build libdoltlite from source for each platform. On Linux this
# runs inside the manylinux container, so build deps go into
# CIBW_BEFORE_ALL_LINUX below.
CIBW_BEFORE_BUILD: bash scripts/build-libdoltlite.sh
# Smoke test: install the wheel into a clean venv and run a
# script that verifies dolt_* functions are wired up.
CIBW_TEST_COMMAND: "python {project}/tests/smoke.py"
# cibuildwheel's macOS Python (python.org-style framework
# build) statically links SQLite into _sqlite3.so — same case
# as python-build-standalone. Our loader has no library
# reference to redirect. The build is unaffected; we run the
# macOS smoke test in a separate job below using Homebrew
# Python (which has dynamic _sqlite3).
CIBW_TEST_SKIP: "*-macosx_*"
# manylinux containers ship a minimal toolchain; doltlite's
# build needs gcc/make (already present), zlib, and tcl for
# configure. yum is available on AlmaLinux 8 (manylinux_2_28).
CIBW_BEFORE_ALL_LINUX: |
yum install -y zlib-devel tcl tcl-devel git
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl
build_sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
smoke_macos:
# Runs against the macOS runner's preinstalled Homebrew Python,
# which links _sqlite3 to a separate libsqlite3.dylib — exactly the
# case the loader targets. cibuildwheel can't run this test inline
# because its bundled Python is framework-style (libsqlite3
# statically linked into _sqlite3.so).
name: macOS smoke (${{ matrix.arch }})
needs: build_wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: macos-14, arch: arm64, brew_prefix: /opt/homebrew }
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: wheelhouse
- name: Install wheel into Homebrew-Python venv
run: |
set -euxo pipefail
# GitHub-hosted runners ship multiple Homebrew Pythons under
# python@3.x; pick the newest that exists.
PY=""
for v in 3.13 3.12 3.11 3.10; do
cand="${{ matrix.brew_prefix }}/opt/python@$v/bin/python$v"
[ -x "$cand" ] && PY="$cand" && break
done
[ -n "$PY" ] || { echo "No Homebrew Python found"; exit 1; }
echo "Using $PY"
"$PY" -m venv venv
venv/bin/pip install wheelhouse/*.whl
venv/bin/python tests/smoke.py
publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist, smoke_macos]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/doltlite
permissions:
id-token: write # required for trusted publisher OIDC exchange
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
# Skip uploads of files that already exist (idempotent re-runs).
skip-existing: true