Skip to content

[IMPROVEMENT] - Switch to maturin action for python wheels #212

@npetzall

Description

@npetzall

🔧 Improvement

Description
InfraWeave currently uses cibuildwheel with maturin as backend.

maturin action is mentioned in the cibuildwheel Tips & Tricks for building rust wheels: https://cibuildwheel.pypa.io/en/stable/faq/#building-rust-wheels

Currently there are two PRs: one for building with cibuildwheel and workspace, and another for building with workspace and the maturin action.

Type

  • Code refactoring
  • Performance improvement
  • Technical debt reduction
  • Dependency update
  • Build/CI improvement
  • Testing improvement
  • Code quality enhancement
  • Other (please specify)

Rationale
Maturin action can build the rust parts once which are not python related and just re-build the bindings for each python version speeding up the build, it can also cross compile.

Proposed Changes
#210

This will also use the same build for testing and release, so there is one re-usable workflow to maintain.
But that's not all, it has a default json for setting up the build but can be extended/reduced using GitHub variables.

Additional Context
The re-usable thing, and the json/GitHub variables can be implemented with cibuildwheel, so they aren't the killer feature. It would probably be the possibility in the future to switch to ABI builds, which covers multiple python versions with a single wheel.

But for comparison there is a single build for macos-arm64 that builds wheels for 3.10, 3.11, 3.12, 3.13 and it takes 10m 42s as total time.

With cibuildwheel this is 4 parallel executions that takes between 10-23 minutes, checking multiple release builds and the time isn't consistent but counting on the low end, it's 4 individual runners, running to 10 minutes each so 40 minutes of runner is consumed. This will also affect the total build times, since I think GitHub has a max concurrent runners limit.

But the biggest question would be, how can I verify that the switch to maturin will work. I've done some inspections and there are only differences in some of the metadata, but the rust file and python file seems to be identical between builds using maturin action and cibuildwheel. I suspect that there should be no difference since both will use maturin for the building.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions