Skip to content

THRIFT-6070: Publish Python wheel distributions to PyPI#3598

Open
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:THRIFT-6070
Open

THRIFT-6070: Publish Python wheel distributions to PyPI#3598
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:THRIFT-6070

Conversation

@HTHou

@HTHou HTHou commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What changed

This updates the PyPI release workflow to build and publish Python wheel distributions in addition to the existing source distribution.

The workflow now:

  • builds the sdist with python -m build and validates it with twine check
  • builds CPython 3.10-3.14 wheels with cibuildwheel
  • covers manylinux x86_64/aarch64, musllinux x86_64/aarch64, macOS x86_64/arm64, and Windows amd64
  • pins manylinux wheels to the manylinux2014 baseline for glibc 2.17+ compatibility
  • keeps PyPI publishing in a separate release-only job with OIDC Trusted Publishing permissions

The release management notes now describe the automated PyPI publishing path and the expected artifacts.

Why

PyPI releases for the Python thrift package currently publish only an sdist, so users without a matching prebuilt wheel must build locally. This adds wheel artifacts while keeping the sdist path intact.

Validation

  • Parsed .github/workflows/pypi.yml as YAML
  • Ran git diff --check
  • Built lib/py sdist in a temporary directory with python -m build --sdist
  • Ran twine check on the generated sdist
  • Verified cibuildwheel==4.1.0 --print-build-identifiers selects the expected CPython 3.10-3.14 targets for Linux, macOS, and Windows

Full multi-platform wheel builds are expected to run in GitHub Actions.

Licensing

cibuildwheel is used as a CI build-time tool and is BSD-2-Clause licensed, which is compatible with Apache License 2.0. No new runtime dependency is added.

AI assistance

Co-Authored-By: Codex noreply@openai.com

Client: py

Co-Authored-By: Codex <noreply@openai.com>
@mergeable mergeable Bot added the github_actions Pull requests that update GitHub Actions code label Jun 15, 2026
@HTHou HTHou marked this pull request as ready for review June 15, 2026 11:17
@HTHou HTHou requested a review from Jens-G as a code owner June 15, 2026 11:17
Copilot AI review requested due to automatic review settings June 15, 2026 11:17
@HTHou HTHou requested review from fishy and jimexist as code owners June 15, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Apache Thrift’s Python release process to use GitHub Actions with PyPI Trusted Publishing, and documents the new workflow-driven publishing steps.

Changes:

  • Replaces manual PyPI upload guidance with workflow-based Trusted Publishing instructions.
  • Splits PyPI workflow into separate sdist and multi-platform wheel build jobs, then publishes from a dedicated job.
  • Adds PR/workflow_dispatch triggers to validate packaging changes without publishing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
doc/ReleaseManagement.md Documents the new PyPI publishing workflow and verification steps for artifacts and Trusted Publishing.
.github/workflows/pypi.yml Implements sdist + wheel builds, gates publishing on release events, and publishes via Trusted Publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +27
pull_request:
branches:
- master
needs:
- build-sdist
- build-wheels
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
Comment thread doc/ReleaseManagement.md
Comment on lines +435 to +436
* [pypi] The `PyPI publishing` GitHub Actions workflow publishes the Python
package when the GitHub release is published. It builds the source
@Jens-G

Jens-G commented Jun 15, 2026

Copy link
Copy Markdown
Member

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants