From e425f0299c7d06194a294793ff1d51ebf23113d2 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Wed, 30 Oct 2024 16:00:31 -0700 Subject: [PATCH] fix python bindings --- pyklang/__init__.py | 2 ++ pyklang/pyproject.toml | 3 --- pyklang/src/lib.rs | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyklang/__init__.py b/pyklang/__init__.py index c4380f2..e9fa6e3 100644 --- a/pyklang/__init__.py +++ b/pyklang/__init__.py @@ -1,3 +1,5 @@ """Defines the top-level package for PyKlang.""" __version__ = "0.0.1" + +from .bindings import add diff --git a/pyklang/pyproject.toml b/pyklang/pyproject.toml index 4117fe1..ea7be96 100644 --- a/pyklang/pyproject.toml +++ b/pyklang/pyproject.toml @@ -5,6 +5,3 @@ build-backend = "maturin" [project] name = "bindings" requires-python = ">=3.9" - -[project.optional-dependencies] -test = ["pytest", "pyright", "ruff"] diff --git a/pyklang/src/lib.rs b/pyklang/src/lib.rs index 19aae2b..c7b2d4d 100644 --- a/pyklang/src/lib.rs +++ b/pyklang/src/lib.rs @@ -9,7 +9,7 @@ fn add(a: u64, b: u64) -> u64 { } #[pymodule] -fn pyklang(m: &Bound) -> PyResult<()> { +fn bindings(m: &Bound) -> PyResult<()> { m.add_function(wrap_pyfunction!(add, m)?)?; Ok(()) } diff --git a/setup.py b/setup.py index 93fea30..a5fc613 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def run(self) -> None: url="https://github.com/kscalelabs/klang", rust_extensions=[ RustExtension( - target="pyklang", + target="pyklang.bindings", path="pyklang/Cargo.toml", binding=Binding.PyO3, ),