build: Python binding portability (#388)

- Specify compatibility = linux in pyproject.toml to ensure
  manylinux compatibility.
- Use abi-py310 pyo3 feature to ensure compatibility with python
  3.10 and later.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-04-07 13:18:01 -07:00
committed by GitHub
parent 77cdac0fef
commit 757edcc8fb
4 changed files with 95 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
[package]
name = "regoruspy"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
repository = "https://github.com/microsoft/regorus/bindings/python"
description = "Python bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
@@ -21,7 +21,7 @@ coverage = ["regorus/coverage"]
[dependencies]
anyhow = "1.0"
ordered-float = "5.0.0"
pyo3 = {version = "0.24.1", features = ["anyhow", "extension-module"] }
pyo3 = { version = "0.24.1", features = ["abi3-py310", "anyhow", "extension-module"] }
regorus = { path = "../..", default-features = false, features = ["arc"] }
serde_json = "1.0.140"

View File

@@ -13,4 +13,8 @@ classifiers = [
dynamic = ["version"]
[tool.maturin]
features = ["pyo3/extension-module"]
binding = ["cffi"]
# See https://github.com/mayeut/pep600_compliance?tab=readme-ov-file#distro-compatibility
# GLIBC releases: https://www.sourceware.org/glibc/wiki/Glibc%20Timeline
compatibility = "manylinux_2_34"
features = ["pyo3/extension-module"]