diff --git a/pdl-compiler/src/backends/rust/mod.rs b/pdl-compiler/src/backends/rust/mod.rs index d37eca7..ae16f6c 100644 --- a/pdl-compiler/src/backends/rust/mod.rs +++ b/pdl-compiler/src/backends/rust/mod.rs @@ -527,6 +527,7 @@ fn generate_root_packet_decl( quote! { #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] + #[cfg_attr(feature = "python", pyo3::pyclass(get_all, set_all))] pub struct #name { #( pub #data_field_ids: #data_field_types, )* #payload_field diff --git a/pdl-tests/Cargo.toml b/pdl-tests/Cargo.toml index 2d0345f..3022aae 100644 --- a/pdl-tests/Cargo.toml +++ b/pdl-tests/Cargo.toml @@ -6,7 +6,9 @@ edition = "2021" description = "PDL Rust generated code tests" [features] +default = ["python"] serde = [] +python = [] [dependencies] bytes = "1.4.0" @@ -19,3 +21,4 @@ proc-macro2 = "1.0.66" quote = "1.0.33" syn = {version = "2.0.29", features = ["full"]} termcolor = "1.2.0" +pyo3 = "0.27.2"