From 7930edc7e62c0dbfa779322464c059ef3dae9c37 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 28 Feb 2024 16:30:32 +0100 Subject: [PATCH] featurizing the library --- Cargo.toml | 22 ++++++++++++---------- members/libpt-py/Cargo.toml | 18 ++++++++++++++++++ members/libpt-py/src/lib.rs | 0 src/lib.rs | 2 ++ 4 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 members/libpt-py/Cargo.toml create mode 100644 members/libpt-py/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 2788037..0961758 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = [ "members/libpt-core", "members/libpt-math", "members/libpt-log", - "members/libpt-net", + "members/libpt-net", "members/libpt-py", ] default-members = [".", "members/libpt-core"] [workspace.package] @@ -33,6 +33,7 @@ libpt-bintols = { version = "0.3.11", path = "members/libpt-bintols" } libpt-log = { version = "0.3.11", path = "members/libpt-log" } libpt-math = { version = "0.3.11", path = "members/libpt-math" } libpt-net = { version = "0.3.11", path = "members/libpt-net" } +libpt-py = { version = "0.3.11", path = "members/libpt-py" } [package] name = "libpt" @@ -51,10 +52,11 @@ categories.workspace = true [features] default = ["log", "core"] core = [] -math = [] -log = [] -bintols = [] -net = [] +math = ["dep:libpt-math"] +log = ["dep:libpt-log"] +bintols = ["dep:libpt-bintols"] +net = ["dep:libpt-net"] +py = ["dep:libpt-py"] [lib] name = "libpt" @@ -65,9 +67,9 @@ crate-type = [ ] [dependencies] -# FIXME: We don't want to compile all of the member crates regardless of features libpt-core = { workspace = true } -libpt-bintols = { workspace = true } -libpt-log = { workspace = true } -libpt-math = { workspace = true } -libpt-net = { workspace = true } +libpt-bintols = { workspace = true, optional = true } +libpt-log = { workspace = true, optional = true } +libpt-math = { workspace = true, optional = true } +libpt-net = { workspace = true, optional = true } +libpt-py = { workspace = true, optional = true } diff --git a/members/libpt-py/Cargo.toml b/members/libpt-py/Cargo.toml new file mode 100644 index 0000000..a924a26 --- /dev/null +++ b/members/libpt-py/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "libpt-py" +publish.workspace = true +version.workspace = true +edition.workspace = true +authors.workspace = true +license.workspace = true +description.workspace = true +readme.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +pyo3 = { version = "0.20.3", features = ["full"] } diff --git a/members/libpt-py/src/lib.rs b/members/libpt-py/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs index 8899a30..776f75d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,3 +18,5 @@ pub use libpt_log as log; pub use libpt_math as math; #[cfg(feature = "net")] pub use libpt_net as net; +#[cfg(feature = "py")] +pub use libpt_py as py;