Skip to content

Commit

Permalink
Maturin: adds a cross-compilation smoke test (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpt authored Jan 30, 2025
1 parent 34ae3e9 commit 46a7752
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions examples/rust-uv-project/.kraken.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import os

from kraken.std import python
from kraken.build import project
from kraken.std import python, cargo
from kraken.std.python.buildsystem.maturin import MaturinZigTarget

python.python_settings(always_use_managed_env=True).add_package_index(
settings = python.python_settings(always_use_managed_env=True).add_package_index(
alias="local",
index_url=os.environ["LOCAL_PACKAGE_INDEX"],
credentials=(os.environ["LOCAL_USER"], os.environ["LOCAL_PASSWORD"]),
)
python.install()
python.mypy(version_spec="==1.10.0")
settings.build_system.enable_zig_build(targets=[
MaturinZigTarget(target="x86_64-unknown-linux-gnu", zig_features=[]),
MaturinZigTarget(
target="x86_64-pc-windows-msvc",
zig_features=["pyo3/generate-import-lib"],
),
])
python.publish(package_index="local", distributions=python.build(as_version="0.1.0").output_files)
project.task("python.build").depends_on(cargo.rustup_target_add("x86_64-pc-windows-msvc"))
2 changes: 1 addition & 1 deletion examples/rust-uv-project/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ authors = []
requires-python = ">=3.9"

[build-system]
requires = ["maturin~=1.0"]
requires = ["maturin[zig]~=1.0"]
build-backend = "maturin"

0 comments on commit 46a7752

Please sign in to comment.