Skip to content

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Sep 3, 2025

resolves #177

Summary by CodeRabbit

  • Chores

    • Build updated to produce ABI3-compatible Python wheels (broader Python 3.x compatibility; no runtime changes).
    • Release workflow updated to use the maintained Python setup action, improved publishing logic (test vs. main registry), and more robust distribution checks.
  • Style

    • Spellchecker dictionary expanded to recognize "pipx".

@2bndy5 2bndy5 added enhancement New feature or request python Pull requests that update Python code labels Sep 3, 2025
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Walkthrough

Adds the abi3-py39 feature to pyo3 in bindings/python/Cargo.toml, updates the release workflow to use actions/setup-python@v5 and pipx/twine invocation, and adds pipx to cspell words. No source code or runtime logic changes.

Changes

Cohort / File(s) Summary
Python bindings dependency update
bindings/python/Cargo.toml
Added abi3-py39 to the pyo3 features list (from ["extension-module"] to ["extension-module","abi3-py39"]).
CI release workflow changes
.github/workflows/python-packaging.yml
Replaced astral-sh/setup-uv@v6 with actions/setup-python@v5 (python-version: 3.x); switched twine check invocation to pipx run twine check dist/*; extended publish step with attestations, skip-existing, and repo URL logic for test vs prod PyPI.
Spellchecker dictionary
cspell.config.yml
Added pipx to recognized words (en language list).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer / PR
  participant CI as GitHub Actions
  participant Build as Build (cargo/pyo3)
  participant Dist as Wheel/Dist
  participant Twine as Twine Check
  participant PyPI as (Test/)PyPI

  Dev->>CI: push PR / merge
  CI->>Build: Setup Python (actions/setup-python@v5)
  CI->>Build: Build wheels (cargo + pyo3 with abi3-py39)
  Build->>Dist: produce dist/*
  CI->>Twine: pipx run twine check dist/*
  Twine-->>CI: validation result
  alt validation OK
    CI->>PyPI: publish (repository-url: test or prod, skip-existing, attestations)
    PyPI-->>CI: publish result
  else validation fails
    CI-->>Dev: fail workflow
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Enable abi3 stable ABI for Python 3.9+ wheels to support forward-compatible builds (#177)

Out-of-scope changes

Code Change Explanation
Replaced setup step and publish logic (.github/workflows/python-packaging.yml) Workflow/CI changes are not required by #177 (which targets adding abi3-py39) — this is CI/tooling modification beyond the ABI objective.
Added pipx to spellchecker (cspell.config.yml) Spellchecker dictionary update is unrelated to the ABI objective.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abi3-py39

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
bindings/python/Cargo.toml (2)

20-20: Optional: add generate-import-lib to ease Windows (cross) builds.

Including PyO3’s generate-import-lib avoids needing Python import libs on MSVC/MinGW targets and makes CI/cross builds smoother. Consider:

-pyo3 = { version = "0.26.0", features = ["extension-module", "abi3-py39"] }
+pyo3 = { version = "0.26.0", features = ["extension-module", "abi3-py39", "generate-import-lib"] }

Refs: PyO3 features docs (abi3, generate-import-lib) and python3-dll-a notes. (pyo3.rs, docs.rs)


20-20: CI/publishing tip: collapse Python matrix and ensure Windows importlib generation.

  • Build one wheel per target/arch (abi3 tag) instead of per Python version.
  • On Windows runners, enable generate-import-lib or provision the appropriate pythonXY.lib.

Refs: PyO3 features guide. (pyo3.rs)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 77a447e and d50f6a3.

📒 Files selected for processing (1)
  • bindings/python/Cargo.toml (1 hunks)
🔇 Additional comments (2)
bindings/python/Cargo.toml (2)

20-20: LGTM: abi3-py39 is the right switch to ship forward-compatible wheels.

This enables the CPython stable ABI for 3.9+, matching the PR goal.


20-20: Verify Python bindings and CI packaging

  • No direct pyo3::ffi or CPython FFI calls detected in bindings/python (ripgrep found none).
  • Confirm CI builds exactly one py3-none-abi3-* wheel per architecture without a Python-version matrix.

Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Walkthrough

Updated bindings/python/Cargo.toml to enable PyO3's abi3-py39 feature alongside extension-module, configuring the Python binding to target the CPython stable ABI for Python 3.9+.

Changes

Cohort / File(s) Summary of Changes
Build configuration: PyO3 features
bindings/python/Cargo.toml
Added PyO3 feature abi3-py39 to existing extension-module feature for ABI3-compatible builds targeting Python 3.9+.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Assessment against linked issues

Objective Addressed Explanation
Distribute forward-compatible Python builds using PyO3 abi3; target Python 3.9+ (#177)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abi3-py39

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
bindings/python/Cargo.toml (2)

20-20: Optional: make ABI3 opt-in/out via a feature alias to ease local dev.

If you want flexibility (e.g., nightly/dev builds without ABI3), re-export PyO3 features via a crate feature instead of hardwiring them on the dependency.

Example (showing intent; adjust to your preferences):

[dependencies]
pyo3 = { version = "0.26.0" } # no features here

[features]
# Default to abi3 for releases; allow opting out locally with `--no-default-features`
default = ["py-abi3"]
py-abi3 = ["pyo3/extension-module", "pyo3/abi3-py39"]

20-20: Docs/CI follow-ups for ABI policy.

Document the new Python support policy (CPython 3.9+) and update release CI to build a single abi3 wheel per target triple (avoid per-Python-version matrices). I can draft a minimal maturin/cibuildwheel matrix if helpful.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 77a447e and d50f6a3.

📒 Files selected for processing (1)
  • bindings/python/Cargo.toml (1 hunks)
🔇 Additional comments (1)
bindings/python/Cargo.toml (1)

20-20: ABI3 enablement looks correct and matches the PR goal.

Adding abi3-py39 alongside extension-module is the right switch for a single wheel per arch that works on CPython ≥3.9.

Please validate the packaging end-to-end:

  • CI builds produce cp39-abi3-tagged wheels for each target (Linux/manylinux, macOS [incl. universal2 if desired], Windows).
  • Import/runtime smoke tests pass on CPython 3.9, 3.10, 3.11, 3.12, and 3.13.
  • The Rust code doesn’t use CPython-version-specific APIs that are outside the limited API (abi3), especially around error formatting, exceptions, or buffer/protocol slots.
  • Windows: confirm the wheel imports without a per-version pythonXY import lib (abi3 import libs should be used automatically by PyO3).

When validating built wheels, there's no need to checkout the repo.
And, setup-uv action is not oriented for this behavior (emits useless warning about missing uv.lock file),
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/python-packaging.yml (2)

193-193: Avoid depending on a preinstalled pipx binary.

Use Python’s module entry point to reduce flakiness on runners where pipx might not be on PATH.

-        run: pipx run twine check dist/*
+        run: python -m pipx run twine check dist/*

186-194: Optional: Assert abi3 wheel tags in the Release job.

Since the PR’s goal is abi3, add a quick guard to fail if any wheel isn’t tagged abi3.

       - uses: actions/download-artifact@v5
         with:
           pattern: wheels-*
           path: dist
           merge-multiple: true
+      - name: Verify wheels are abi3-tagged
+        if: ${{ !startsWith(github.ref, 'refs/tags/') }}
+        shell: bash
+        run: |
+          set -euo pipefail
+          bad=$(ls dist/*.whl | awk -F/ '{print $NF}' | grep -v -- '-abi3- || true')
+          if [[ -n "${bad}" ]]; then
+            echo "Non-abi3 wheels found:"
+            echo "${bad}"
+            exit 1
+          fi
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d50f6a3 and 9c48a3a.

📒 Files selected for processing (2)
  • .github/workflows/python-packaging.yml (1 hunks)
  • cspell.config.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: linux (ubuntu-latest, armv7)
  • GitHub Check: linux (ubuntu-latest, ppc64le)
  • GitHub Check: linux (ubuntu-latest, aarch64)
  • GitHub Check: linux (ubuntu-latest, x86_64)
  • GitHub Check: linux (ubuntu-latest, x86)
  • GitHub Check: windows (windows-latest, x64)
  • GitHub Check: macos (macos-13, x86_64)
  • GitHub Check: macos (macos-14, aarch64)
  • GitHub Check: windows (windows-latest, x86)
🔇 Additional comments (2)
cspell.config.yml (1)

73-73: Add "pipx" to dictionary — looks good.

Keeps CI logs clean for the new workflow usage.

.github/workflows/python-packaging.yml (1)

186-190: Conditional Python setup is appropriate for non-tag runs.

Matches the conditional “twine check” step and avoids unnecessary setup on tag releases.

@2bndy5 2bndy5 merged commit 4be28e8 into main Sep 3, 2025
19 checks passed
@2bndy5 2bndy5 deleted the abi3-py39 branch September 3, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

distribute forward-compatible python builds
1 participant