From c69d116c7584308c3fbc80c2286e0ab9f701f5d6 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 28 Feb 2024 22:06:55 +0100 Subject: [PATCH] fix py feature --- Cargo.toml | 13 ++++++++----- members/libpt-py/.gitignore | 2 +- members/libpt-py/Cargo.toml | 10 ++++++---- members/libpt-py/pyproject.toml | 6 +++--- members/libpt-py/src/lib.rs | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0961758..e925040 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,9 +5,11 @@ members = [ "members/libpt-core", "members/libpt-math", "members/libpt-log", - "members/libpt-net", "members/libpt-py", + "members/libpt-net", + "members/libpt-py", ] default-members = [".", "members/libpt-core"] + [workspace.package] publish = true version = "0.3.11" @@ -18,7 +20,7 @@ description = "Personal multitool" readme = "README.md" homepage = "https://git.cscherr.de/PlexSheep/pt" repository = "https://git.cscherr.de/PlexSheep/pt" -keywords = ["cli", "library"] +keywords = ["library"] categories = [ "command-line-utilities", "development-tools", @@ -52,10 +54,11 @@ categories.workspace = true [features] default = ["log", "core"] core = [] -math = ["dep:libpt-math"] +full = ["default", "core", "math", "log", "bintols", "net", "py"] +math = ["dep:libpt-math", "log"] log = ["dep:libpt-log"] -bintols = ["dep:libpt-bintols"] -net = ["dep:libpt-net"] +bintols = ["dep:libpt-bintols", "log"] +net = ["dep:libpt-net", "log"] py = ["dep:libpt-py"] [lib] diff --git a/members/libpt-py/.gitignore b/members/libpt-py/.gitignore index af3ca5e..c8f0442 100644 --- a/members/libpt-py/.gitignore +++ b/members/libpt-py/.gitignore @@ -69,4 +69,4 @@ docs/_build/ .vscode/ # Pyenv -.python-version \ No newline at end of file +.python-version diff --git a/members/libpt-py/Cargo.toml b/members/libpt-py/Cargo.toml index 2ebdf45..921b7c4 100644 --- a/members/libpt-py/Cargo.toml +++ b/members/libpt-py/Cargo.toml @@ -1,12 +1,14 @@ [package] name = "libpt-py" version = "0.3.11" -edition = "2021" +edition.workspace = true + +[package.metadata.maturin] +name = "libpt" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -name = "libpt" -crate-type = ["cdylib"] +crate-type = ["cdylib", "rlib"] [dependencies] -pyo3 = { version = "0.19.0", features = ["full", "extension-module"] } +pyo3 = "0.19.0" diff --git a/members/libpt-py/pyproject.toml b/members/libpt-py/pyproject.toml index 7d42dc0..0b1145a 100644 --- a/members/libpt-py/pyproject.toml +++ b/members/libpt-py/pyproject.toml @@ -1,16 +1,16 @@ [build-system] -requires = ["maturin>=1.1,<2.0"] +requires = ["maturin>=1.4,<2.0"] build-backend = "maturin" [project] name = "libpt" -requires-python = ">=3.7" +requires-python = ">=3.8" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] - +dynamic = ["version"] [tool.maturin] features = ["pyo3/extension-module"] diff --git a/members/libpt-py/src/lib.rs b/members/libpt-py/src/lib.rs index b226085..04c4570 100644 --- a/members/libpt-py/src/lib.rs +++ b/members/libpt-py/src/lib.rs @@ -8,7 +8,7 @@ fn sum_as_string(a: usize, b: usize) -> PyResult { /// A Python module implemented in Rust. #[pymodule] -#[pyo3(name="libpt")] +#[pyo3(name = "libpt")] fn libpt_py(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; Ok(())