Skip to content

Commit 3735a3d

Browse files
rithulkameshclaude
andcommitted
feat: maturin — bundle Rust binary in Python wheel, matrix CI builds
- Rename binary devsper → devsper-runtime (no collision with Python entry point) - Switch python/ build backend hatchling → maturin (bindings=bin) - CI: 5-platform matrix (linux x64/arm64, mac x64/arm64, win x64) - pip install devsper now ships devsper-runtime binary, zero extra steps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8b919c0 commit 3735a3d

3 files changed

Lines changed: 50 additions & 23 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,55 @@ jobs:
9090
- name: Publish devsper-bin
9191
run: cargo publish -p devsper-bin --no-verify || true
9292

93+
build-wheels:
94+
name: Build wheels (${{ matrix.target }})
95+
needs: test
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
include:
100+
- os: ubuntu-latest
101+
target: x86_64-unknown-linux-gnu
102+
- os: ubuntu-latest
103+
target: aarch64-unknown-linux-gnu
104+
- os: macos-latest
105+
target: x86_64-apple-darwin
106+
- os: macos-latest
107+
target: aarch64-apple-darwin
108+
- os: windows-latest
109+
target: x86_64-pc-windows-msvc
110+
runs-on: ${{ matrix.os }}
111+
steps:
112+
- uses: actions/checkout@v4
113+
114+
- uses: PyO3/maturin-action@v1
115+
with:
116+
target: ${{ matrix.target }}
117+
args: --release --out dist
118+
working-directory: python
119+
manylinux: auto
120+
121+
- uses: actions/upload-artifact@v4
122+
with:
123+
name: wheels-${{ matrix.target }}
124+
path: python/dist/
125+
93126
publish-pypi:
94127
name: Publish to PyPI
95-
needs: test
128+
needs: build-wheels
96129
runs-on: ubuntu-latest
97130
environment:
98131
name: pypi
99132
url: https://pypi.org/project/devsper/
100133
permissions:
101-
id-token: write # required for trusted publisher (OIDC)
134+
id-token: write
102135
steps:
103-
- uses: actions/checkout@v4
104-
105-
- name: Set up Python
106-
uses: actions/setup-python@v5
136+
- uses: actions/download-artifact@v4
107137
with:
108-
python-version: "3.11"
109-
110-
- name: Install build tools
111-
run: pip install hatch
112-
113-
- name: Build wheel + sdist
114-
working-directory: python
115-
run: hatch build
138+
pattern: wheels-*
139+
merge-multiple: true
140+
path: dist/
116141

117-
- name: Publish to PyPI (trusted publisher)
118-
uses: pypa/gh-action-pypi-publish@release/v1
142+
- uses: pypa/gh-action-pypi-publish@release/v1
119143
with:
120-
packages-dir: python/dist/
144+
packages-dir: dist/

crates/devsper-bin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version.workspace = true
1111
edition.workspace = true
1212

1313
[[bin]]
14-
name = "devsper"
14+
name = "devsper-runtime"
1515
path = "src/main.rs"
1616

1717
[dependencies]

python/pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["hatchling"]
3-
build-backend = "hatchling.build"
2+
requires = ["maturin>=1.7"]
3+
build-backend = "maturin"
44

55
[project]
66
name = "devsper"
7-
version = "3.0.1"
7+
version = "3.0.2"
88
description = "Devsper runtime CLI — self-evolving AI workflow engine"
99
readme = "README.md"
1010
requires-python = ">=3.11"
@@ -35,5 +35,8 @@ eval = [
3535
[project.scripts]
3636
devsper = "devsper.cli:main"
3737

38-
[tool.hatch.build.targets.wheel]
39-
packages = ["devsper"]
38+
[tool.maturin]
39+
bindings = "bin"
40+
manifest-path = "../crates/devsper-bin/Cargo.toml"
41+
python-packages = ["devsper"]
42+
strip = true

0 commit comments

Comments
 (0)