Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Pola rs Polars Release Python Workflow

From Leeroopedia


Knowledge Sources
Domains CI_CD, Release_Engineering
Last Updated 2026-02-09 09:00 GMT

Overview

Concrete tool for building and publishing Python Polars releases across multiple platforms provided by the GitHub Actions CI/CD pipeline.

Description

The release-python.yml workflow orchestrates the complete Python Polars release pipeline. It builds three runtime variants (polars-runtime-32, polars-runtime-64, polars-runtime-compat) across eight platform targets (linux-x64, linux-arm64, linux-musl-x64, linux-musl-arm64, macos-x64, macos-arm64, win-x64, win-arm64). The workflow uses maturin for building Python wheels from Rust source code via PyO3 bindings. It configures CPU-specific feature flags (SSE3/SSE4/AVX/AVX2/FMA for x86-64) with a compatibility mode that uses a reduced instruction set. The pipeline includes version validation across all runtime Cargo.toml files, source distribution creation and testing, wheel building with platform-specific optimizations (jemalloc on Linux, LLVM on ARM64 Windows), and automated publishing to PyPI and GitHub Releases.

Usage

Trigger this workflow via workflow_dispatch when preparing a new Python Polars release. It accepts an optional sha parameter to pin the release to a specific commit and a dry-run flag to build without publishing. The workflow handles the complete release lifecycle from sdist creation through wheel building to PyPI and GitHub publication.

Code Reference

Source Location

Signature

name: Release Python
on:
  workflow_dispatch:
    inputs:
      sha:
        description: Commit SHA
        type: string
      dry-run:
        description: Dry run
        type: boolean
        default: false

jobs:
  base-package:     # Build sdist and base wheel
  create-sdist:     # Create source distributions for each runtime
  build-wheels:     # Build platform-specific wheels (8 targets x 3 runtimes)
  publish-to-pypi:  # Publish to PyPI via trusted publishing
  publish-to-github: # Create GitHub Release and trigger downstream workflows

Import

# Triggered via GitHub Actions workflow_dispatch
# No direct import; used as CI/CD pipeline

I/O Contract

Inputs

Name Type Required Description
sha string No Commit SHA to build from (defaults to latest on main)
dry-run boolean No If true, build artifacts but do not publish (default: false)

Outputs

Name Type Description
sdist .tar.gz Source distribution for each runtime variant
wheels .whl Platform-specific wheels for 8 targets x 3 runtime variants
PyPI release Publication Packages published to pypi.org/project/polars
GitHub release Release Tagged release with auto-generated changelog
repository-dispatch Event Triggers downstream workflows via python-release event

Usage Examples

Triggering a Release

# Via GitHub UI: Actions > Release Python > Run workflow
# Or via GitHub CLI:
gh workflow run release-python.yml \
  --field sha=abc123def \
  --field dry-run=false

Platform Matrix

Runtime Variants:
  - polars-runtime-32  (standard 32-bit index)
  - polars-runtime-64  (64-bit index / bigidx)
  - polars-runtime-compat (SSE-only compatibility mode)

Platform Targets:
  - linux-x64      (x86_64-unknown-linux-gnu)
  - linux-arm64    (aarch64-unknown-linux-gnu)
  - linux-musl-x64 (x86_64-unknown-linux-musl)
  - linux-musl-arm64 (aarch64-unknown-linux-musl)
  - macos-x64      (x86_64-apple-darwin)
  - macos-arm64    (aarch64-apple-darwin)
  - win-x64        (x86_64-pc-windows-msvc)
  - win-arm64      (aarch64-pc-windows-msvc)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment