From 2694e916c3b8cfd1369261f557c9914844cb0211 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Tue, 11 Jun 2024 20:29:58 -0400 Subject: [PATCH 01/12] Add the proc macro --- Cargo.lock | 37 +++++++++++++++++-- Cargo.toml | 1 + derive/Cargo.toml | 14 ++++++++ derive/src/lib.rs | 74 ++++++++++++++++++++++++++++++++++++++ derive/tests/functional.rs | 43 ++++++++++++++++++++++ 5 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 derive/Cargo.toml create mode 100644 derive/src/lib.rs create mode 100644 derive/tests/functional.rs diff --git a/Cargo.lock b/Cargo.lock index 20f9639e..f8c9d338 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2139,6 +2139,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "pyo3", + "quote", + "quote_into", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.10.7" @@ -4578,7 +4589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -6630,6 +6641,28 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "quote_into" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93886ed56f228a5d960fc4d26afa3736df12a251872869cf24f5efe5f07699b9" +dependencies = [ + "proc-macro2", + "quote", + "quote_into_macro", +] + +[[package]] +name = "quote_into_macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36b828998c40452b5afe441c75194e93181432e669585f4ceb7b0d32a3f73525" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "radium" version = "0.7.0" @@ -9595,7 +9628,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index de189996..5449bea7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,7 @@ members = [ "libraries/extensions/ros2-bridge", "libraries/extensions/ros2-bridge/msg-gen", "libraries/extensions/ros2-bridge/python", + "derive", ] [workspace.package] diff --git a/derive/Cargo.toml b/derive/Cargo.toml new file mode 100644 index 00000000..4157d0cb --- /dev/null +++ b/derive/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "derive" +version = "0.1.0" +edition = "2021" + +[dependencies] +syn = "1.0" +quote = "1.0" +proc-macro2 = "1.0" +quote_into = "0.2.0" +pyo3 = { workspace = true, features = ["eyre", "abi3-py37"] } + +[lib] +proc-macro = true \ No newline at end of file diff --git a/derive/src/lib.rs b/derive/src/lib.rs new file mode 100644 index 00000000..50c5d1cd --- /dev/null +++ b/derive/src/lib.rs @@ -0,0 +1,74 @@ +extern crate proc_macro; +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, Data, DeriveInput, Fields}; + +/// Add a Python `__dir__`` method to the struct. +#[proc_macro_derive(DirHelper)] +pub fn dir_helper_derive(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + + // Get the name of the struct + let name = &input.ident; + + // Generate code to match the struct's fields + let expanded = match input.data { + Data::Struct(data) => { + match data.fields { + Fields::Named(fields) => { + // If the struct has named fields extract their names + let field_names = fields + .named + .iter() + .map(|f| f.ident.as_ref().unwrap()) + .collect::>(); + + // Prepare an array where the elements are expressions that prepare the field vec + let mut assigner = proc_macro2::TokenStream::new(); + quote_into::quote_into!(assigner += [#{ + for name in field_names { + quote_into::quote_into!(assigner += (names.push(stringify!(#name).to_string())),) + } + }];); + quote! { + #[pyo3::prelude::pymethods] + impl #name { + pub fn __dir__(&self) -> Vec { + let mut names = Vec::new(); + #assigner + names + } + } + } + } + Fields::Unit => { + // If the struct has no fields + quote! { + #[pyo3::prelude::pymethods] + impl #name { + pub fn __dir__(&self) -> Vec { + Vec::new() + } + } + } + } + Fields::Unnamed(_) => { + quote! { + compile_error!("Unnamed fields for struct are not supported for DirHelper derive."); + } + } + } + } + Data::Enum(_) => { + quote! { + compile_error!("Enums are not supported for DirHelper derive"); + } + } + Data::Union(_) => { + quote! { + compile_error!("Unions are not supported for DirHelper derive"); + } + } + }; + TokenStream::from(expanded) +} diff --git a/derive/tests/functional.rs b/derive/tests/functional.rs new file mode 100644 index 00000000..04d91035 --- /dev/null +++ b/derive/tests/functional.rs @@ -0,0 +1,43 @@ +use derive::DirHelper; +use pyo3::pyclass; + +#[derive(DirHelper)] +#[pyclass] +#[allow(dead_code)] +struct WithFields { + hello: (), + dora: u32, + my: String, + name: f32, +} + +#[test] +fn test_with_fields() { + let fields = WithFields { + hello: (), + dora: 0, + my: "".to_string(), + name: 0.0, + } + .__dir__(); + assert_eq!( + vec![ + "hello".to_string(), + "dora".to_string(), + "my".to_string(), + "name".to_string() + ], + fields + ); +} + +#[derive(DirHelper)] +#[pyclass] +#[allow(dead_code)] +struct UnitNoFields; + +#[test] +fn test_no_fields() { + let fields: Vec = UnitNoFields.__dir__(); + assert_eq!(Vec::::new(), fields); +} From 5995ac28de0206cbe31e80dc9fbd0903e8070e28 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Tue, 11 Jun 2024 20:37:38 -0400 Subject: [PATCH 02/12] PoC in Node --- Cargo.lock | 2 +- Cargo.toml | 1 + apis/python/node/Cargo.toml | 1 + apis/python/node/src/lib.rs | 8 ++++++++ derive/Cargo.toml | 1 - derive/src/lib.rs | 14 +++++++++----- derive/tests/functional.rs | 7 ++----- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8c9d338..f6c68717 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2144,7 +2144,6 @@ name = "derive" version = "0.1.0" dependencies = [ "proc-macro2", - "pyo3", "quote", "quote_into", "syn 1.0.109", @@ -2457,6 +2456,7 @@ name = "dora-node-api-python" version = "0.3.4" dependencies = [ "arrow", + "derive", "dora-node-api", "dora-operator-api-python", "dora-ros2-bridge-python", diff --git a/Cargo.toml b/Cargo.toml index 5449bea7..8dfe2520 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,6 +67,7 @@ dora-coordinator = { version = "0.3.4", path = "binaries/coordinator" } dora-ros2-bridge = { path = "libraries/extensions/ros2-bridge" } dora-ros2-bridge-msg-gen = { path = "libraries/extensions/ros2-bridge/msg-gen" } dora-ros2-bridge-python = { path = "libraries/extensions/ros2-bridge/python" } +derive = { path = "derive" } arrow = { version = "52" } arrow-schema = { version = "52" } arrow-data = { version = "52" } diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 6e05782a..2156a8e4 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -25,6 +25,7 @@ arrow = { workspace = true, features = ["pyarrow"] } pythonize = { workspace = true } futures = "0.3.28" dora-ros2-bridge-python = { workspace = true } +derive = { workspace = true } [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index ba9c6c46..a44c3a76 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -24,6 +24,7 @@ use pyo3::types::{PyBytes, PyDict}; /// ``` /// #[pyclass] +#[derive(derive::DirHelper)] pub struct Node { events: Events, node: DoraNode, @@ -197,6 +198,13 @@ impl Node { Ok(()) } + + // TODO: We should only list fields which are at least readableby Python users, right? + + /// Get a list of the fields of this Node. + pub fn __dir__(&self) -> Vec { + self.fields() + } } enum Events { diff --git a/derive/Cargo.toml b/derive/Cargo.toml index 4157d0cb..9c2a4e11 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -8,7 +8,6 @@ syn = "1.0" quote = "1.0" proc-macro2 = "1.0" quote_into = "0.2.0" -pyo3 = { workspace = true, features = ["eyre", "abi3-py37"] } [lib] proc-macro = true \ No newline at end of file diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 50c5d1cd..4398a59f 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -1,9 +1,15 @@ +//! Derive macros for dora + extern crate proc_macro; use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, Data, DeriveInput, Fields}; -/// Add a Python `__dir__`` method to the struct. +/// Add a `fields` method to the struct. +/// +/// Because we cannot have multiple `#[pymethods]` impls, this macro +/// produces a function called `fields` which should be called from the +/// PyO3 impl. #[proc_macro_derive(DirHelper)] pub fn dir_helper_derive(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); @@ -31,9 +37,8 @@ pub fn dir_helper_derive(input: TokenStream) -> TokenStream { } }];); quote! { - #[pyo3::prelude::pymethods] impl #name { - pub fn __dir__(&self) -> Vec { + pub fn fields(&self) -> Vec { let mut names = Vec::new(); #assigner names @@ -44,9 +49,8 @@ pub fn dir_helper_derive(input: TokenStream) -> TokenStream { Fields::Unit => { // If the struct has no fields quote! { - #[pyo3::prelude::pymethods] impl #name { - pub fn __dir__(&self) -> Vec { + pub fn fields(&self) -> Vec { Vec::new() } } diff --git a/derive/tests/functional.rs b/derive/tests/functional.rs index 04d91035..7b8452cc 100644 --- a/derive/tests/functional.rs +++ b/derive/tests/functional.rs @@ -1,8 +1,6 @@ use derive::DirHelper; -use pyo3::pyclass; #[derive(DirHelper)] -#[pyclass] #[allow(dead_code)] struct WithFields { hello: (), @@ -19,7 +17,7 @@ fn test_with_fields() { my: "".to_string(), name: 0.0, } - .__dir__(); + .fields(); assert_eq!( vec![ "hello".to_string(), @@ -32,12 +30,11 @@ fn test_with_fields() { } #[derive(DirHelper)] -#[pyclass] #[allow(dead_code)] struct UnitNoFields; #[test] fn test_no_fields() { - let fields: Vec = UnitNoFields.__dir__(); + let fields: Vec = UnitNoFields.fields(); assert_eq!(Vec::::new(), fields); } From c40204d4d69bb09734e6e73d4654f8f019e2b9df Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Tue, 11 Jun 2024 23:29:56 -0400 Subject: [PATCH 03/12] Format --- apis/python/node/src/lib.rs | 4 ++-- derive/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index a44c3a76..e7d65565 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -200,8 +200,8 @@ impl Node { } // TODO: We should only list fields which are at least readableby Python users, right? - - /// Get a list of the fields of this Node. + + /// Get a list of the fields of this Node. pub fn __dir__(&self) -> Vec { self.fields() } diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 4398a59f..58501d32 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -6,7 +6,7 @@ use quote::quote; use syn::{parse_macro_input, Data, DeriveInput, Fields}; /// Add a `fields` method to the struct. -/// +/// /// Because we cannot have multiple `#[pymethods]` impls, this macro /// produces a function called `fields` which should be called from the /// PyO3 impl. From 19e26358b6c89e8b1d66fe1f15c5e4297c44b433 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 07:11:02 -0400 Subject: [PATCH 04/12] Rename and use multiple_pymethods trait --- Cargo.lock | 24 ++++++++++--------- Cargo.toml | 6 ++--- apis/python/node/Cargo.toml | 4 ++-- apis/python/node/src/lib.rs | 9 +------ .../Cargo.toml | 3 ++- .../src/lib.rs | 8 +++++-- .../tests/functional.rs | 9 ++++--- 7 files changed, 33 insertions(+), 30 deletions(-) rename {derive => python_special_method_derive}/Cargo.toml (63%) rename {derive => python_special_method_derive}/src/lib.rs (89%) rename {derive => python_special_method_derive}/tests/functional.rs (79%) diff --git a/Cargo.lock b/Cargo.lock index f6c68717..9cc4478a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2139,16 +2139,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "quote_into", - "syn 1.0.109", -] - [[package]] name = "digest" version = "0.10.7" @@ -2456,7 +2446,6 @@ name = "dora-node-api-python" version = "0.3.4" dependencies = [ "arrow", - "derive", "dora-node-api", "dora-operator-api-python", "dora-ros2-bridge-python", @@ -2465,6 +2454,7 @@ dependencies = [ "flume 0.10.14", "futures", "pyo3", + "python_special_method_derive", "pythonize", "serde_yaml 0.8.26", ] @@ -6507,6 +6497,7 @@ dependencies = [ "cfg-if 1.0.0", "eyre", "indoc", + "inventory", "libc", "memoffset 0.9.1", "parking_lot", @@ -6563,6 +6554,17 @@ dependencies = [ "syn 2.0.65", ] +[[package]] +name = "python_special_method_derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "pyo3", + "quote", + "quote_into", + "syn 1.0.109", +] + [[package]] name = "pythonize" version = "0.21.1" diff --git a/Cargo.toml b/Cargo.toml index 8dfe2520..8bdc19a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ members = [ "libraries/extensions/ros2-bridge", "libraries/extensions/ros2-bridge/msg-gen", "libraries/extensions/ros2-bridge/python", - "derive", + "python_special_method_derive", ] [workspace.package] @@ -67,12 +67,12 @@ dora-coordinator = { version = "0.3.4", path = "binaries/coordinator" } dora-ros2-bridge = { path = "libraries/extensions/ros2-bridge" } dora-ros2-bridge-msg-gen = { path = "libraries/extensions/ros2-bridge/msg-gen" } dora-ros2-bridge-python = { path = "libraries/extensions/ros2-bridge/python" } -derive = { path = "derive" } +python_special_method_derive = { path = "python_special_method_derive" } arrow = { version = "52" } arrow-schema = { version = "52" } arrow-data = { version = "52" } arrow-array = { version = "52" } -pyo3 = "0.21" +pyo3 = { version = "0.21", workspace = true, features = ["eyre", "abi3-py37", "multiple-pymethods"] } pythonize = "0.21" [package] diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 2156a8e4..2eb10e04 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -16,7 +16,7 @@ telemetry = ["dora-runtime/telemetry"] [dependencies] dora-node-api = { workspace = true } dora-operator-api-python = { workspace = true } -pyo3 = { workspace = true, features = ["eyre", "abi3-py37"] } +pyo3.workspace = true eyre = "0.6" serde_yaml = "0.8.23" flume = "0.10.14" @@ -25,7 +25,7 @@ arrow = { workspace = true, features = ["pyarrow"] } pythonize = { workspace = true } futures = "0.3.28" dora-ros2-bridge-python = { workspace = true } -derive = { workspace = true } +python_special_method_derive = { workspace = true } [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index e7d65565..1a69a086 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -24,7 +24,7 @@ use pyo3::types::{PyBytes, PyDict}; /// ``` /// #[pyclass] -#[derive(derive::DirHelper)] +#[derive(python_special_method_derive::DirHelper)] pub struct Node { events: Events, node: DoraNode, @@ -198,13 +198,6 @@ impl Node { Ok(()) } - - // TODO: We should only list fields which are at least readableby Python users, right? - - /// Get a list of the fields of this Node. - pub fn __dir__(&self) -> Vec { - self.fields() - } } enum Events { diff --git a/derive/Cargo.toml b/python_special_method_derive/Cargo.toml similarity index 63% rename from derive/Cargo.toml rename to python_special_method_derive/Cargo.toml index 9c2a4e11..e2e816fa 100644 --- a/derive/Cargo.toml +++ b/python_special_method_derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "derive" +name = "python_special_method_derive" version = "0.1.0" edition = "2021" @@ -8,6 +8,7 @@ syn = "1.0" quote = "1.0" proc-macro2 = "1.0" quote_into = "0.2.0" +pyo3.workspace = true [lib] proc-macro = true \ No newline at end of file diff --git a/derive/src/lib.rs b/python_special_method_derive/src/lib.rs similarity index 89% rename from derive/src/lib.rs rename to python_special_method_derive/src/lib.rs index 58501d32..77ca2b5c 100644 --- a/derive/src/lib.rs +++ b/python_special_method_derive/src/lib.rs @@ -5,6 +5,8 @@ use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, Data, DeriveInput, Fields}; +// TODO: We should only list fields which are at least readableby Python users, right? + /// Add a `fields` method to the struct. /// /// Because we cannot have multiple `#[pymethods]` impls, this macro @@ -37,8 +39,9 @@ pub fn dir_helper_derive(input: TokenStream) -> TokenStream { } }];); quote! { + #[pyo3::pymethods] impl #name { - pub fn fields(&self) -> Vec { + pub fn __dir__(&self) -> Vec { let mut names = Vec::new(); #assigner names @@ -49,8 +52,9 @@ pub fn dir_helper_derive(input: TokenStream) -> TokenStream { Fields::Unit => { // If the struct has no fields quote! { + #[pyo3::pymethods] impl #name { - pub fn fields(&self) -> Vec { + pub fn __dir__(&self) -> Vec { Vec::new() } } diff --git a/derive/tests/functional.rs b/python_special_method_derive/tests/functional.rs similarity index 79% rename from derive/tests/functional.rs rename to python_special_method_derive/tests/functional.rs index 7b8452cc..ec5b25c6 100644 --- a/derive/tests/functional.rs +++ b/python_special_method_derive/tests/functional.rs @@ -1,5 +1,7 @@ -use derive::DirHelper; +use pyo3::pyclass; +use python_special_method_derive::DirHelper; +#[pyclass] #[derive(DirHelper)] #[allow(dead_code)] struct WithFields { @@ -17,7 +19,7 @@ fn test_with_fields() { my: "".to_string(), name: 0.0, } - .fields(); + .__dir__(); assert_eq!( vec![ "hello".to_string(), @@ -29,12 +31,13 @@ fn test_with_fields() { ); } +#[pyclass] #[derive(DirHelper)] #[allow(dead_code)] struct UnitNoFields; #[test] fn test_no_fields() { - let fields: Vec = UnitNoFields.fields(); + let fields: Vec = UnitNoFields.__dir__(); assert_eq!(Vec::::new(), fields); } From 4369c8fb27c4ae7b22e9631b3c74cd3b6ecf530e Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 07:11:41 -0400 Subject: [PATCH 05/12] Update to use workspace version --- Cargo.lock | 2 +- python_special_method_derive/Cargo.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9cc4478a..cbc411b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6556,7 +6556,7 @@ dependencies = [ [[package]] name = "python_special_method_derive" -version = "0.1.0" +version = "0.3.4" dependencies = [ "proc-macro2", "pyo3", diff --git a/python_special_method_derive/Cargo.toml b/python_special_method_derive/Cargo.toml index e2e816fa..318471cf 100644 --- a/python_special_method_derive/Cargo.toml +++ b/python_special_method_derive/Cargo.toml @@ -1,8 +1,12 @@ [package] name = "python_special_method_derive" -version = "0.1.0" +version.workspace = true edition = "2021" +documentation.workspace = true +description.workspace = true +license.workspace = true + [dependencies] syn = "1.0" quote = "1.0" From aaa2881c456f68ca5ab19a8a3fa52e4e986cd989 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 07:13:46 -0400 Subject: [PATCH 06/12] Comments --- python_special_method_derive/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python_special_method_derive/src/lib.rs b/python_special_method_derive/src/lib.rs index 77ca2b5c..1b889718 100644 --- a/python_special_method_derive/src/lib.rs +++ b/python_special_method_derive/src/lib.rs @@ -1,11 +1,13 @@ -//! Derive macros for dora +//! Derive macros to help with Python extern crate proc_macro; use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, Data, DeriveInput, Fields}; -// TODO: We should only list fields which are at least readableby Python users, right? +// TODO: We should only list fields which are at least readable by Python users. +// This would require either reading the visibility modifier (easier) or checking +// the `pyo3` getter /// Add a `fields` method to the struct. /// From ef476b0c87b8c31b78cae0cdc80135002f8b8278 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 15:03:33 -0400 Subject: [PATCH 07/12] Add str and repr derives --- Cargo.toml | 2 +- python_special_method_derive/src/lib.rs | 171 +++++++++++++++++- .../tests/functional.rs | 49 +++-- 3 files changed, 203 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8bdc19a2..954398a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,7 @@ arrow = { version = "52" } arrow-schema = { version = "52" } arrow-data = { version = "52" } arrow-array = { version = "52" } -pyo3 = { version = "0.21", workspace = true, features = ["eyre", "abi3-py37", "multiple-pymethods"] } +pyo3 = { version = "0.21", features = ["eyre", "abi3-py37", "multiple-pymethods"] } pythonize = "0.21" [package] diff --git a/python_special_method_derive/src/lib.rs b/python_special_method_derive/src/lib.rs index 1b889718..8e73d287 100644 --- a/python_special_method_derive/src/lib.rs +++ b/python_special_method_derive/src/lib.rs @@ -9,11 +9,7 @@ use syn::{parse_macro_input, Data, DeriveInput, Fields}; // This would require either reading the visibility modifier (easier) or checking // the `pyo3` getter -/// Add a `fields` method to the struct. -/// -/// Because we cannot have multiple `#[pymethods]` impls, this macro -/// produces a function called `fields` which should be called from the -/// PyO3 impl. +/// Add a `__dir__` method to the struct in a `#[pymethods]` impl #[proc_macro_derive(DirHelper)] pub fn dir_helper_derive(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); @@ -82,3 +78,168 @@ pub fn dir_helper_derive(input: TokenStream) -> TokenStream { }; TokenStream::from(expanded) } + +/// Add a `__str__` and `__repr__` method to the struct in a `#[pymethods]` impl +#[proc_macro_derive(StrReprHelper)] +pub fn str_repr_helper_derive(input_stream: TokenStream) -> TokenStream { + let input = parse_macro_input!(input_stream as DeriveInput); + + // Get the name of the struct + let name = &input.ident; + + let display_debug_derive_body = display_debug_derive(&input); + + let expanded = quote! { + #display_debug_derive_body + + #[pyo3::pymethods] + impl #name { + pub fn __str__(&self) -> String { + format!("{self}") + } + + pub fn __repr__(&self) -> String { + format!("{self:?}") + } + } + }; + + TokenStream::from(expanded) +} + +macro_rules! create_body { + ($input:expr, $ident:expr, $debug:expr) => { + match &$input.data { + syn::Data::Struct(s) => generate_fmt_impl_for_struct(s, $debug), + syn::Data::Enum(e) => generate_fmt_impl_for_enum(e, $ident, $debug), + syn::Data::Union(u) => { + let error = syn::Error::new_spanned(u.union_token, "Unions are not supported"); + return proc_macro2::TokenStream::from(error.into_compile_error()); + } + } + }; +} + +// Internal function to generate Display and Debug impls. +// `Display` is used for `__str__`. `Debug` is used for `__repr__`. +fn display_debug_derive(input: &DeriveInput) -> proc_macro2::TokenStream { + // Get the name of the struct + let ident = &input.ident; + + let body_display = create_body!(input, ident, false); + + let body_debug = create_body!(input, ident, true); + + let expanded = quote! { + impl std::fmt::Debug for #ident { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}(", stringify!(#ident))?; + #(#body_debug)* + write!(f, ")") + } + } + + impl std::fmt::Display for #ident { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}(", stringify!(#ident))?; + #(#body_display)* + write!(f, ")") + } + } + }; + + expanded +} + +fn generate_fmt_impl_for_struct( + data_struct: &syn::DataStruct, + debug: bool, +) -> Vec { + let fields = &data_struct.fields; + let n_fields = fields.len(); + let field_fmts = fields + .iter() + .enumerate() + .map(|(i, field)| { + // TODO: handle if debug. This may be checking visibility or only + // displaying user specified idents. For now, repr the fields in Debug. + let postfix = if i + 1 < n_fields { ", " } else { "" }; + match &field.ident { + Some(ident) => { + if debug { + quote! { + write!(f, "{}: {:?}{}", stringify!(#ident), self.#ident, #postfix)?; + } + } else { + quote! { + write!(f, "{}: `{}`{}", stringify!(#ident), self.#ident, #postfix)?; + } + } + } + None => { + // If the field doesn't have a name, we generate a name based on its index + let index = syn::Index::from(i); + if debug { + quote! { write!(f, "{}: `{:?}`{}", stringify!(#index), self.#index, #postfix)?; } + } else { + quote! { write!(f, "{}: `{}`{}", stringify!(#index), self.#index, #postfix)?; } + } + } + } + }) + .collect::>(); + // Collect the mapped tokens into a TokenStream + field_fmts +} + +fn generate_fmt_impl_for_enum( + data_enum: &syn::DataEnum, + ident: &syn::Ident, + _debug: bool, +) -> Vec { + let n_variants = data_enum.variants.len(); + data_enum + .variants + .iter().enumerate() + .map(|(i, variant)| { + let variant_name = &variant.ident; + // TODO: handle if debug. This may be only + // displaying user specified variants. + let variant_fmt = match &variant.fields { + syn::Fields::Unit => { + // If the variant has no fields, we just print its name + quote! { write!(f, "{}", stringify!(#variant_name))?; } + } + syn::Fields::Named(fields) => { + // If the variant has named fields, we print each field's name and value + let field_fmts = fields.named.iter().map(|field| { + let field_name = field.ident.as_ref().unwrap(); + let postfix = if i + 1 < n_variants { ", " } else { "" }; + quote! { + write!(f, "{}: `{:?}`{}", stringify!(#field_name), self.#field_name, #postfix)?; + } + }); + quote! { + write!(f, "{} {{ ", stringify!(#variant_name))?; + #( #field_fmts )* + write!(f, " }}")?; + } + } + syn::Fields::Unnamed(fields) => { + // If the variant has unnamed fields, we print each field's value without names + let field_fmts = fields.unnamed.iter().map(|field| { + quote! { + write!(f, "{:?}, ", self.#field)?; + } + }); + quote! { + write!(f, "{}(", stringify!(#variant_name))?; + #( #field_fmts )* + write!(f, ")")?; + } + } + }; + quote! { #ident::#variant_name => { #variant_fmt } } + }) + .collect::>() +} diff --git a/python_special_method_derive/tests/functional.rs b/python_special_method_derive/tests/functional.rs index ec5b25c6..4cbc3ace 100644 --- a/python_special_method_derive/tests/functional.rs +++ b/python_special_method_derive/tests/functional.rs @@ -1,33 +1,56 @@ use pyo3::pyclass; -use python_special_method_derive::DirHelper; +use python_special_method_derive::{DirHelper, StrReprHelper}; #[pyclass] -#[derive(DirHelper)] +#[derive(DirHelper, StrReprHelper)] #[allow(dead_code)] struct WithFields { - hello: (), dora: u32, my: String, name: f32, } #[test] -fn test_with_fields() { - let fields = WithFields { - hello: (), +fn test_with_dir() { + let dir = WithFields { dora: 0, my: "".to_string(), name: 0.0, } .__dir__(); assert_eq!( - vec![ - "hello".to_string(), - "dora".to_string(), - "my".to_string(), - "name".to_string() - ], - fields + vec!["dora".to_string(), "my".to_string(), "name".to_string()], + dir + ); +} + +#[test] +fn test_with_str() { + let res = WithFields { + dora: 299792458, + my: "Hello world".to_string(), + name: 3.14159, + } + .__str__(); + // TOOD: Is this a good __str__ output? How can we better show it or should they be different? + assert_eq!( + "WithFields(dora: `299792458`, my: `Hello world`, name: `3.14159`)", + &res + ); +} + +#[test] +fn test_with_repr() { + let res = WithFields { + dora: 299792458, + my: "Hello world".to_string(), + name: 3.14159, + } + .__repr__(); + // TOOD: Is this a good __repr__ output? How can we better show it or should they be different? + assert_eq!( + "WithFields(dora: 299792458, my: \"Hello world\", name: 3.14159)", + &res ); } From 1c47b2b202a71b626963be49f5a6d3db3bc0c8d7 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 15:17:27 -0400 Subject: [PATCH 08/12] Typo --- python_special_method_derive/tests/functional.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python_special_method_derive/tests/functional.rs b/python_special_method_derive/tests/functional.rs index 4cbc3ace..b46904a7 100644 --- a/python_special_method_derive/tests/functional.rs +++ b/python_special_method_derive/tests/functional.rs @@ -32,7 +32,7 @@ fn test_with_str() { name: 3.14159, } .__str__(); - // TOOD: Is this a good __str__ output? How can we better show it or should they be different? + // TODO: Is this a good __str__ output? How can we better show it or should they be different? assert_eq!( "WithFields(dora: `299792458`, my: `Hello world`, name: `3.14159`)", &res @@ -47,7 +47,7 @@ fn test_with_repr() { name: 3.14159, } .__repr__(); - // TOOD: Is this a good __repr__ output? How can we better show it or should they be different? + // TODO: Is this a good __repr__ output? How can we better show it or should they be different? assert_eq!( "WithFields(dora: 299792458, my: \"Hello world\", name: 3.14159)", &res From 50bd86d09fedf615b20c4a206bd2dce1520f55ba Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Wed, 12 Jun 2024 23:31:46 -0400 Subject: [PATCH 09/12] Better format? --- python_special_method_derive/src/lib.rs | 10 +++++----- python_special_method_derive/tests/functional.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python_special_method_derive/src/lib.rs b/python_special_method_derive/src/lib.rs index 8e73d287..001e37e9 100644 --- a/python_special_method_derive/src/lib.rs +++ b/python_special_method_derive/src/lib.rs @@ -168,11 +168,11 @@ fn generate_fmt_impl_for_struct( Some(ident) => { if debug { quote! { - write!(f, "{}: {:?}{}", stringify!(#ident), self.#ident, #postfix)?; + write!(f, "{}={:?}{}", stringify!(#ident), self.#ident, #postfix)?; } } else { quote! { - write!(f, "{}: `{}`{}", stringify!(#ident), self.#ident, #postfix)?; + write!(f, "{}=`{}`{}", stringify!(#ident), self.#ident, #postfix)?; } } } @@ -180,9 +180,9 @@ fn generate_fmt_impl_for_struct( // If the field doesn't have a name, we generate a name based on its index let index = syn::Index::from(i); if debug { - quote! { write!(f, "{}: `{:?}`{}", stringify!(#index), self.#index, #postfix)?; } + quote! { write!(f, "{}=`{:?}`{}", stringify!(#index), self.#index, #postfix)?; } } else { - quote! { write!(f, "{}: `{}`{}", stringify!(#index), self.#index, #postfix)?; } + quote! { write!(f, "{}=`{}`{}", stringify!(#index), self.#index, #postfix)?; } } } } @@ -216,7 +216,7 @@ fn generate_fmt_impl_for_enum( let field_name = field.ident.as_ref().unwrap(); let postfix = if i + 1 < n_variants { ", " } else { "" }; quote! { - write!(f, "{}: `{:?}`{}", stringify!(#field_name), self.#field_name, #postfix)?; + write!(f, "{}=`{:?}`{}", stringify!(#field_name), self.#field_name, #postfix)?; } }); quote! { diff --git a/python_special_method_derive/tests/functional.rs b/python_special_method_derive/tests/functional.rs index b46904a7..e3df5406 100644 --- a/python_special_method_derive/tests/functional.rs +++ b/python_special_method_derive/tests/functional.rs @@ -34,7 +34,7 @@ fn test_with_str() { .__str__(); // TODO: Is this a good __str__ output? How can we better show it or should they be different? assert_eq!( - "WithFields(dora: `299792458`, my: `Hello world`, name: `3.14159`)", + "WithFields(dora=`299792458`, my=`Hello world`, name=`3.14159`)", &res ); } @@ -49,7 +49,7 @@ fn test_with_repr() { .__repr__(); // TODO: Is this a good __repr__ output? How can we better show it or should they be different? assert_eq!( - "WithFields(dora: 299792458, my: \"Hello world\", name: 3.14159)", + "WithFields(dora=299792458, my=\"Hello world\", name=3.14159)", &res ); } From 8ff6d39a8423772a0722a9fa7756a760e6939806 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Fri, 14 Jun 2024 02:44:45 -0400 Subject: [PATCH 10/12] Use the new crate --- Cargo.lock | 98 +++---- Cargo.toml | 2 - apis/python/node/Cargo.toml | 2 +- apis/python/node/src/lib.rs | 5 +- python_special_method_derive/Cargo.toml | 18 -- python_special_method_derive/src/lib.rs | 245 ------------------ .../tests/functional.rs | 66 ----- 7 files changed, 54 insertions(+), 382 deletions(-) delete mode 100644 python_special_method_derive/Cargo.toml delete mode 100644 python_special_method_derive/src/lib.rs delete mode 100644 python_special_method_derive/tests/functional.rs diff --git a/Cargo.lock b/Cargo.lock index cbc411b8..13ab4fb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -775,7 +775,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -854,7 +854,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -871,7 +871,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1321,7 +1321,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1590,7 +1590,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2033,7 +2033,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2050,7 +2050,7 @@ checksum = "b8cb317cb13604b4752416783bb25070381c36e844743e4146b7f8e55de7d140" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2074,7 +2074,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2085,7 +2085,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2454,7 +2454,7 @@ dependencies = [ "flume 0.10.14", "futures", "pyo3", - "python_special_method_derive", + "pyo3_special_method_derive", "pythonize", "serde_yaml 0.8.26", ] @@ -2896,7 +2896,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2917,7 +2917,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2928,7 +2928,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -2949,7 +2949,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -3279,7 +3279,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -3445,7 +3445,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -3540,7 +3540,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -3644,7 +3644,7 @@ dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -5285,7 +5285,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -5357,7 +5357,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6017,7 +6017,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6058,7 +6058,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6339,7 +6339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6411,7 +6411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6434,7 +6434,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6538,7 +6538,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -6551,18 +6551,20 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] -name = "python_special_method_derive" -version = "0.3.4" +name = "pyo3_special_method_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba8f52c03a4a510534a6cea6a44e3872a7287392e7c9b8ffe9a9409d736f10a" dependencies = [ "proc-macro2", "pyo3", "quote", "quote_into", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -7536,7 +7538,7 @@ dependencies = [ "re_log", "re_tracing", "rust-format", - "syn 2.0.65", + "syn 2.0.66", "tempfile", "unindent", "xshell", @@ -8389,7 +8391,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -8512,7 +8514,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -8523,7 +8525,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -8545,7 +8547,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -8898,7 +8900,7 @@ checksum = "658f2ca5276b92c3dfd65fa88316b4e032ace68f88d7570b43967784c0bac5ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -8996,7 +8998,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9009,7 +9011,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9037,9 +9039,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.65" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -9180,7 +9182,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9350,7 +9352,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9507,7 +9509,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9848,7 +9850,7 @@ checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -9963,7 +9965,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -9997,7 +9999,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10795,7 +10797,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -11386,7 +11388,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 954398a4..3ad9d7f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,6 @@ members = [ "libraries/extensions/ros2-bridge", "libraries/extensions/ros2-bridge/msg-gen", "libraries/extensions/ros2-bridge/python", - "python_special_method_derive", ] [workspace.package] @@ -67,7 +66,6 @@ dora-coordinator = { version = "0.3.4", path = "binaries/coordinator" } dora-ros2-bridge = { path = "libraries/extensions/ros2-bridge" } dora-ros2-bridge-msg-gen = { path = "libraries/extensions/ros2-bridge/msg-gen" } dora-ros2-bridge-python = { path = "libraries/extensions/ros2-bridge/python" } -python_special_method_derive = { path = "python_special_method_derive" } arrow = { version = "52" } arrow-schema = { version = "52" } arrow-data = { version = "52" } diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 2eb10e04..a51e0857 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -25,7 +25,7 @@ arrow = { workspace = true, features = ["pyarrow"] } pythonize = { workspace = true } futures = "0.3.28" dora-ros2-bridge-python = { workspace = true } -python_special_method_derive = { workspace = true } +pyo3_special_method_derive = "0.1.0" [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index 1a69a086..d738d72e 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -11,6 +11,7 @@ use eyre::Context; use futures::{Stream, StreamExt}; use pyo3::prelude::*; use pyo3::types::{PyBytes, PyDict}; +use pyo3_special_method_derive::DirHelper; /// The custom node API lets you integrate `dora` into your application. /// It allows you to retrieve input and send output in any fashion you want. @@ -24,10 +25,10 @@ use pyo3::types::{PyBytes, PyDict}; /// ``` /// #[pyclass] -#[derive(python_special_method_derive::DirHelper)] +#[derive(DirHelper)] pub struct Node { events: Events, - node: DoraNode, + pub node: DoraNode, } #[pymethods] diff --git a/python_special_method_derive/Cargo.toml b/python_special_method_derive/Cargo.toml deleted file mode 100644 index 318471cf..00000000 --- a/python_special_method_derive/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "python_special_method_derive" -version.workspace = true -edition = "2021" - -documentation.workspace = true -description.workspace = true -license.workspace = true - -[dependencies] -syn = "1.0" -quote = "1.0" -proc-macro2 = "1.0" -quote_into = "0.2.0" -pyo3.workspace = true - -[lib] -proc-macro = true \ No newline at end of file diff --git a/python_special_method_derive/src/lib.rs b/python_special_method_derive/src/lib.rs deleted file mode 100644 index 001e37e9..00000000 --- a/python_special_method_derive/src/lib.rs +++ /dev/null @@ -1,245 +0,0 @@ -//! Derive macros to help with Python - -extern crate proc_macro; -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, Data, DeriveInput, Fields}; - -// TODO: We should only list fields which are at least readable by Python users. -// This would require either reading the visibility modifier (easier) or checking -// the `pyo3` getter - -/// Add a `__dir__` method to the struct in a `#[pymethods]` impl -#[proc_macro_derive(DirHelper)] -pub fn dir_helper_derive(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); - - // Get the name of the struct - let name = &input.ident; - - // Generate code to match the struct's fields - let expanded = match input.data { - Data::Struct(data) => { - match data.fields { - Fields::Named(fields) => { - // If the struct has named fields extract their names - let field_names = fields - .named - .iter() - .map(|f| f.ident.as_ref().unwrap()) - .collect::>(); - - // Prepare an array where the elements are expressions that prepare the field vec - let mut assigner = proc_macro2::TokenStream::new(); - quote_into::quote_into!(assigner += [#{ - for name in field_names { - quote_into::quote_into!(assigner += (names.push(stringify!(#name).to_string())),) - } - }];); - quote! { - #[pyo3::pymethods] - impl #name { - pub fn __dir__(&self) -> Vec { - let mut names = Vec::new(); - #assigner - names - } - } - } - } - Fields::Unit => { - // If the struct has no fields - quote! { - #[pyo3::pymethods] - impl #name { - pub fn __dir__(&self) -> Vec { - Vec::new() - } - } - } - } - Fields::Unnamed(_) => { - quote! { - compile_error!("Unnamed fields for struct are not supported for DirHelper derive."); - } - } - } - } - Data::Enum(_) => { - quote! { - compile_error!("Enums are not supported for DirHelper derive"); - } - } - Data::Union(_) => { - quote! { - compile_error!("Unions are not supported for DirHelper derive"); - } - } - }; - TokenStream::from(expanded) -} - -/// Add a `__str__` and `__repr__` method to the struct in a `#[pymethods]` impl -#[proc_macro_derive(StrReprHelper)] -pub fn str_repr_helper_derive(input_stream: TokenStream) -> TokenStream { - let input = parse_macro_input!(input_stream as DeriveInput); - - // Get the name of the struct - let name = &input.ident; - - let display_debug_derive_body = display_debug_derive(&input); - - let expanded = quote! { - #display_debug_derive_body - - #[pyo3::pymethods] - impl #name { - pub fn __str__(&self) -> String { - format!("{self}") - } - - pub fn __repr__(&self) -> String { - format!("{self:?}") - } - } - }; - - TokenStream::from(expanded) -} - -macro_rules! create_body { - ($input:expr, $ident:expr, $debug:expr) => { - match &$input.data { - syn::Data::Struct(s) => generate_fmt_impl_for_struct(s, $debug), - syn::Data::Enum(e) => generate_fmt_impl_for_enum(e, $ident, $debug), - syn::Data::Union(u) => { - let error = syn::Error::new_spanned(u.union_token, "Unions are not supported"); - return proc_macro2::TokenStream::from(error.into_compile_error()); - } - } - }; -} - -// Internal function to generate Display and Debug impls. -// `Display` is used for `__str__`. `Debug` is used for `__repr__`. -fn display_debug_derive(input: &DeriveInput) -> proc_macro2::TokenStream { - // Get the name of the struct - let ident = &input.ident; - - let body_display = create_body!(input, ident, false); - - let body_debug = create_body!(input, ident, true); - - let expanded = quote! { - impl std::fmt::Debug for #ident { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "{}(", stringify!(#ident))?; - #(#body_debug)* - write!(f, ")") - } - } - - impl std::fmt::Display for #ident { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "{}(", stringify!(#ident))?; - #(#body_display)* - write!(f, ")") - } - } - }; - - expanded -} - -fn generate_fmt_impl_for_struct( - data_struct: &syn::DataStruct, - debug: bool, -) -> Vec { - let fields = &data_struct.fields; - let n_fields = fields.len(); - let field_fmts = fields - .iter() - .enumerate() - .map(|(i, field)| { - // TODO: handle if debug. This may be checking visibility or only - // displaying user specified idents. For now, repr the fields in Debug. - let postfix = if i + 1 < n_fields { ", " } else { "" }; - match &field.ident { - Some(ident) => { - if debug { - quote! { - write!(f, "{}={:?}{}", stringify!(#ident), self.#ident, #postfix)?; - } - } else { - quote! { - write!(f, "{}=`{}`{}", stringify!(#ident), self.#ident, #postfix)?; - } - } - } - None => { - // If the field doesn't have a name, we generate a name based on its index - let index = syn::Index::from(i); - if debug { - quote! { write!(f, "{}=`{:?}`{}", stringify!(#index), self.#index, #postfix)?; } - } else { - quote! { write!(f, "{}=`{}`{}", stringify!(#index), self.#index, #postfix)?; } - } - } - } - }) - .collect::>(); - // Collect the mapped tokens into a TokenStream - field_fmts -} - -fn generate_fmt_impl_for_enum( - data_enum: &syn::DataEnum, - ident: &syn::Ident, - _debug: bool, -) -> Vec { - let n_variants = data_enum.variants.len(); - data_enum - .variants - .iter().enumerate() - .map(|(i, variant)| { - let variant_name = &variant.ident; - // TODO: handle if debug. This may be only - // displaying user specified variants. - let variant_fmt = match &variant.fields { - syn::Fields::Unit => { - // If the variant has no fields, we just print its name - quote! { write!(f, "{}", stringify!(#variant_name))?; } - } - syn::Fields::Named(fields) => { - // If the variant has named fields, we print each field's name and value - let field_fmts = fields.named.iter().map(|field| { - let field_name = field.ident.as_ref().unwrap(); - let postfix = if i + 1 < n_variants { ", " } else { "" }; - quote! { - write!(f, "{}=`{:?}`{}", stringify!(#field_name), self.#field_name, #postfix)?; - } - }); - quote! { - write!(f, "{} {{ ", stringify!(#variant_name))?; - #( #field_fmts )* - write!(f, " }}")?; - } - } - syn::Fields::Unnamed(fields) => { - // If the variant has unnamed fields, we print each field's value without names - let field_fmts = fields.unnamed.iter().map(|field| { - quote! { - write!(f, "{:?}, ", self.#field)?; - } - }); - quote! { - write!(f, "{}(", stringify!(#variant_name))?; - #( #field_fmts )* - write!(f, ")")?; - } - } - }; - quote! { #ident::#variant_name => { #variant_fmt } } - }) - .collect::>() -} diff --git a/python_special_method_derive/tests/functional.rs b/python_special_method_derive/tests/functional.rs deleted file mode 100644 index e3df5406..00000000 --- a/python_special_method_derive/tests/functional.rs +++ /dev/null @@ -1,66 +0,0 @@ -use pyo3::pyclass; -use python_special_method_derive::{DirHelper, StrReprHelper}; - -#[pyclass] -#[derive(DirHelper, StrReprHelper)] -#[allow(dead_code)] -struct WithFields { - dora: u32, - my: String, - name: f32, -} - -#[test] -fn test_with_dir() { - let dir = WithFields { - dora: 0, - my: "".to_string(), - name: 0.0, - } - .__dir__(); - assert_eq!( - vec!["dora".to_string(), "my".to_string(), "name".to_string()], - dir - ); -} - -#[test] -fn test_with_str() { - let res = WithFields { - dora: 299792458, - my: "Hello world".to_string(), - name: 3.14159, - } - .__str__(); - // TODO: Is this a good __str__ output? How can we better show it or should they be different? - assert_eq!( - "WithFields(dora=`299792458`, my=`Hello world`, name=`3.14159`)", - &res - ); -} - -#[test] -fn test_with_repr() { - let res = WithFields { - dora: 299792458, - my: "Hello world".to_string(), - name: 3.14159, - } - .__repr__(); - // TODO: Is this a good __repr__ output? How can we better show it or should they be different? - assert_eq!( - "WithFields(dora=299792458, my=\"Hello world\", name=3.14159)", - &res - ); -} - -#[pyclass] -#[derive(DirHelper)] -#[allow(dead_code)] -struct UnitNoFields; - -#[test] -fn test_no_fields() { - let fields: Vec = UnitNoFields.__dir__(); - assert_eq!(Vec::::new(), fields); -} From 42dcb07237e8f83e4ba24c9468b41d18b66ab4be Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Thu, 20 Jun 2024 17:06:14 +0200 Subject: [PATCH 11/12] Add derivation fo rpython ros2 bridge --- Cargo.lock | 5 +++-- apis/python/node/Cargo.toml | 2 +- apis/python/node/src/lib.rs | 4 ++-- libraries/extensions/ros2-bridge/python/Cargo.toml | 1 + libraries/extensions/ros2-bridge/python/src/lib.rs | 8 +++++++- libraries/extensions/ros2-bridge/python/src/qos.rs | 7 ++++--- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13ab4fb2..46cd13aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2588,6 +2588,7 @@ dependencies = [ "eyre", "futures", "pyo3", + "pyo3_special_method_derive", "serde", "serde_assert", ] @@ -6556,9 +6557,9 @@ dependencies = [ [[package]] name = "pyo3_special_method_derive" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba8f52c03a4a510534a6cea6a44e3872a7287392e7c9b8ffe9a9409d736f10a" +checksum = "e831c9f620de245243f105f2d764c59c32a853bd1c9fb34504116e0d6d094fad" dependencies = [ "proc-macro2", "pyo3", diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index a51e0857..7d5cac89 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -25,7 +25,7 @@ arrow = { workspace = true, features = ["pyarrow"] } pythonize = { workspace = true } futures = "0.3.28" dora-ros2-bridge-python = { workspace = true } -pyo3_special_method_derive = "0.1.0" +pyo3_special_method_derive = "0.2.1" [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index d738d72e..00693d71 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -11,7 +11,7 @@ use eyre::Context; use futures::{Stream, StreamExt}; use pyo3::prelude::*; use pyo3::types::{PyBytes, PyDict}; -use pyo3_special_method_derive::DirHelper; +use pyo3_special_method_derive::Dir; /// The custom node API lets you integrate `dora` into your application. /// It allows you to retrieve input and send output in any fashion you want. @@ -25,7 +25,7 @@ use pyo3_special_method_derive::DirHelper; /// ``` /// #[pyclass] -#[derive(DirHelper)] +#[derive(Dir)] pub struct Node { events: Events, pub node: DoraNode, diff --git a/libraries/extensions/ros2-bridge/python/Cargo.toml b/libraries/extensions/ros2-bridge/python/Cargo.toml index fd1b8627..92bcad08 100644 --- a/libraries/extensions/ros2-bridge/python/Cargo.toml +++ b/libraries/extensions/ros2-bridge/python/Cargo.toml @@ -12,6 +12,7 @@ eyre = "0.6" serde = "1.0.166" arrow = { workspace = true, features = ["pyarrow"] } futures = "0.3.28" +pyo3_special_method_derive = "0.2.1" [dev-dependencies] serde_assert = "0.7.1" diff --git a/libraries/extensions/ros2-bridge/python/src/lib.rs b/libraries/extensions/ros2-bridge/python/src/lib.rs index ee7f6830..7819cfaa 100644 --- a/libraries/extensions/ros2-bridge/python/src/lib.rs +++ b/libraries/extensions/ros2-bridge/python/src/lib.rs @@ -18,6 +18,7 @@ use pyo3::{ types::{PyAnyMethods, PyDict, PyList, PyModule, PyModuleMethods}, Bound, PyAny, PyObject, PyResult, Python, }; +use pyo3_special_method_derive::{Dict, Dir, Repr, Str}; use typed::{deserialize::StructDeserializer, TypeInfo, TypedValue}; pub mod qos; @@ -45,6 +46,7 @@ pub mod typed; /// :type ros_paths: typing.List[str], optional /// #[pyclass] +#[derive(Str, Repr, Dir, Dict)] pub struct Ros2Context { context: ros2_client::Context, messages: Arc>>, @@ -147,6 +149,7 @@ impl Ros2Context { /// See: https://github.com/jhelovuo/ros2-client/issues/4 /// #[pyclass] +#[derive(Str, Repr, Dir, Dict)] pub struct Ros2Node { node: ros2_client::Node, messages: Arc>>, @@ -251,7 +254,7 @@ impl Ros2Node { /// ROS2 Node Options /// :type rosout: bool, optional /// -#[derive(Debug, Clone, Default)] +#[derive(Clone, Default, Str, Repr, Dir, Dict)] #[pyclass] #[non_exhaustive] pub struct Ros2NodeOptions { @@ -281,6 +284,7 @@ impl From for ros2_client::NodeOptions { /// - dora Ros2 bridge functionality is considered **unstable**. It may be changed /// at any point without it being considered a breaking change. #[pyclass] +#[derive(Str, Repr, Dir, Dict)] #[non_exhaustive] pub struct Ros2Topic { topic: rustdds::Topic, @@ -293,6 +297,7 @@ pub struct Ros2Topic { /// - dora Ros2 bridge functionality is considered **unstable**. It may be changed /// at any point without it being considered a breaking change. #[pyclass] +#[derive(Str, Repr, Dir, Dict)] #[non_exhaustive] pub struct Ros2Publisher { publisher: ros2_client::Publisher>, @@ -363,6 +368,7 @@ impl Ros2Publisher { /// - dora Ros2 bridge functionality is considered **unstable**. It may be changed /// at any point without it being considered a breaking change. #[pyclass] +#[derive(Str, Repr, Dir, Dict)] #[non_exhaustive] pub struct Ros2Subscription { deserializer: StructDeserializer<'static>, diff --git a/libraries/extensions/ros2-bridge/python/src/qos.rs b/libraries/extensions/ros2-bridge/python/src/qos.rs index 626934f5..33412f56 100644 --- a/libraries/extensions/ros2-bridge/python/src/qos.rs +++ b/libraries/extensions/ros2-bridge/python/src/qos.rs @@ -1,5 +1,6 @@ use ::dora_ros2_bridge::rustdds::{self, policy}; use pyo3::prelude::{pyclass, pymethods}; +use pyo3_special_method_derive::{Dict, Dir, Repr, Str}; /// ROS2 QoS Policy /// @@ -12,7 +13,7 @@ use pyo3::prelude::{pyclass, pymethods}; /// :type keep_last: int, optional /// :rtype: dora.Ros2QoSPolicies /// -#[derive(Debug, Clone)] +#[derive(Clone, Str, Repr, Dir, Dict)] #[pyclass] #[non_exhaustive] pub struct Ros2QosPolicies { @@ -77,7 +78,7 @@ impl From for rustdds::QosPolicies { /// DDS 2.2.3.4 DURABILITY /// /// :rtype: dora.Ros2Durability -#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Str, Repr, Dir, Dict)] #[pyclass] pub enum Ros2Durability { Volatile, @@ -103,7 +104,7 @@ impl From for policy::Durability { /// DDS 2.2.3.11 LIVELINESS /// :rtype: dora.Ros2Liveliness -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, PartialEq, Str, Repr, Dir, Dict)] #[pyclass] pub enum Ros2Liveliness { Automatic, From 233192f41ee7d131ee1df788e847163ab58aaaf0 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Tue, 25 Jun 2024 14:43:18 -0400 Subject: [PATCH 12/12] Update deps --- Cargo.lock | 527 +++++++++--------- apis/python/node/Cargo.toml | 3 +- .../extensions/ros2-bridge/python/Cargo.toml | 3 +- 3 files changed, 259 insertions(+), 274 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02bbd0b3..6b87b7cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -180,7 +180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 2.5.0", + "bitflags 2.6.0", "cc", "cesu8", "jni", @@ -256,9 +256,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -510,7 +510,7 @@ version = "52.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32aae6a60458a2389c0da89c9de0b7932427776127da1a738e2efc21d32f3393" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "serde", ] @@ -542,7 +542,7 @@ dependencies = [ "memchr", "num", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -617,16 +617,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", @@ -653,7 +653,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", ] @@ -666,8 +666,8 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", "once_cell", @@ -696,17 +696,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if 1.0.0", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -724,12 +724,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite", ] @@ -739,7 +739,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "blocking", "futures-lite 2.3.0", ] @@ -775,7 +775,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -791,12 +791,12 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "atomic-waker", "cfg-if 1.0.0", "futures-core", @@ -854,7 +854,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -871,7 +871,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -883,15 +883,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "atomic" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" -dependencies = [ - "bytemuck", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -976,7 +967,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "itoa", "matchit", "memchr", @@ -1016,9 +1007,9 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -1145,9 +1136,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "bytemuck", "serde", @@ -1229,12 +1220,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel 2.3.1", - "async-lock 3.3.0", "async-task", "futures-io", "futures-lite 2.3.0", @@ -1280,7 +1270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "serde", ] @@ -1309,22 +1299,22 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1360,9 +1350,9 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "log", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "thiserror", @@ -1427,9 +1417,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" dependencies = [ "jobserver", "libc", @@ -1566,7 +1556,7 @@ checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", + "clap_lex 0.7.1", "strsim 0.11.1", "terminal_size", ] @@ -1593,7 +1583,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1607,9 +1597,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clean-path" @@ -1737,8 +1727,8 @@ version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "unicode-width", ] @@ -2046,7 +2036,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2063,7 +2053,7 @@ checksum = "4b2c1c1776b986979be68bb2285da855f8d8a35851a769fca8740df7c3d07877" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2087,7 +2077,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2098,7 +2088,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2238,7 +2228,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.3", + "libloading 0.8.4", ] [[package]] @@ -2472,6 +2462,7 @@ dependencies = [ "futures", "pyo3", "pyo3_special_method_derive", + "pyo3_special_method_derive_lib", "pythonize", "serde_yaml 0.8.26", ] @@ -2606,6 +2597,7 @@ dependencies = [ "futures", "pyo3", "pyo3_special_method_derive", + "pyo3_special_method_derive_lib", "serde", "serde_assert", ] @@ -2914,14 +2906,14 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -2929,13 +2921,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2946,7 +2938,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2967,7 +2959,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3069,43 +3061,22 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.3.1", "pin-project-lite", ] @@ -3297,7 +3268,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3463,7 +3434,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3537,9 +3508,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "git-version" @@ -3558,7 +3529,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3567,7 +3538,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "libgit2-sys", "log", @@ -3610,8 +3581,8 @@ dependencies = [ "aho-corasick", "bstr 1.9.1", "log", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3662,7 +3633,7 @@ dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3692,7 +3663,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gpu-alloc-types", ] @@ -3702,7 +3673,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3724,7 +3695,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gpu-descriptor-types", "hashbrown 0.14.5", ] @@ -3735,7 +3706,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3811,10 +3782,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "com", "libc", - "libloading 0.8.3", + "libloading 0.8.4", "thiserror", "widestring", "winapi 0.3.9", @@ -3856,6 +3827,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -3931,12 +3908,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -3944,9 +3921,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -3962,9 +3939,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -3977,7 +3954,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -4018,7 +3995,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 0.26.1", + "webpki-roots 0.26.3", ] [[package]] @@ -4027,7 +4004,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -4035,9 +4012,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", @@ -4445,7 +4422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.3", + "libloading 0.8.4", "pkg-config", ] @@ -4486,11 +4463,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -4593,12 +4570,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -4613,7 +4590,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "redox_syscall 0.4.1", ] @@ -4624,15 +4601,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "libc", @@ -4798,9 +4775,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -4854,7 +4831,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block", "core-graphics-types", "foreign-types", @@ -4887,9 +4864,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -4983,7 +4960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ "bit-set", - "bitflags 2.5.0", + "bitflags 2.6.0", "codespan-reporting", "hexf-parse", "indexmap 2.2.6", @@ -5040,7 +5017,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "jni-sys", "log", "ndk-sys", @@ -5147,7 +5124,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "cfg_aliases 0.1.1", "libc", @@ -5199,7 +5176,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -5304,7 +5281,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5376,7 +5353,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5481,7 +5458,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -5497,7 +5474,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -5542,7 +5519,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -5554,7 +5531,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -5566,7 +5543,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -5593,9 +5570,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -5886,9 +5863,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -5902,7 +5879,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -6036,7 +6013,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6077,7 +6054,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6094,9 +6071,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -6298,13 +6275,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if 1.0.0", "concurrent-queue", - "hermit-abi 0.3.9", + "hermit-abi 0.4.0", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -6358,7 +6335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6430,7 +6407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6453,7 +6430,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6491,7 +6468,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] @@ -6502,7 +6479,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] @@ -6557,7 +6534,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6570,22 +6547,29 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "pyo3_special_method_derive" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e831c9f620de245243f105f2d764c59c32a853bd1c9fb34504116e0d6d094fad" +checksum = "4f42480b1d189c6ff58bf7fdf3df6a452e8d7931d978b1f2f6c3a3cbb9da6c87" dependencies = [ "proc-macro2", "pyo3", + "pyo3_special_method_derive_lib", "quote", "quote_into", - "syn 2.0.66", + "syn 2.0.68", ] +[[package]] +name = "pyo3_special_method_derive_lib" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee61e71376a5c2fdd9e2abb183c58f44b8a2005159b69f0d25ecdcbfed8b6aa" + [[package]] name = "pythonize" version = "0.21.1" @@ -7189,7 +7173,7 @@ checksum = "2902018a22e9cb535737582bc2c26e8e4939d0b24a5cd404c61919739e1f6d61" dependencies = [ "ahash", "anyhow", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytemuck", "cfg-if 1.0.0", "cfg_aliases 0.2.1", @@ -7360,7 +7344,7 @@ checksum = "ee0c742b6de79ca773bed2aa9255c2f0cad0a4b43181fed025d43e52a5885b73" dependencies = [ "ahash", "anyhow", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytemuck", "egui", "glam", @@ -7604,7 +7588,7 @@ dependencies = [ "re_log", "re_tracing", "rust-format", - "syn 2.0.66", + "syn 2.0.68", "tempfile", "unindent", "xshell", @@ -7808,7 +7792,7 @@ dependencies = [ "clap 4.5.7", "document-features", "futures-util", - "hyper 0.14.28", + "hyper 0.14.29", "re_analytics", "re_log", "thiserror", @@ -7861,11 +7845,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -7887,8 +7871,8 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -7902,13 +7886,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -7919,9 +7903,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "renderdoc-sys" @@ -7967,7 +7951,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots 0.26.3", "winreg", ] @@ -8105,7 +8089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "serde", "serde_derive", ] @@ -8304,7 +8288,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -8480,7 +8464,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8517,7 +8501,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -8588,9 +8572,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -8603,7 +8587,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8614,14 +8598,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -8636,7 +8620,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8893,7 +8877,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -8989,7 +8973,7 @@ checksum = "658f2ca5276b92c3dfd65fa88316b4e032ace68f88d7570b43967784c0bac5ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9013,7 +8997,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -9073,9 +9057,9 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" [[package]] name = "strum_macros" @@ -9087,20 +9071,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9111,9 +9095,9 @@ checksum = "fa7986063f7c0ab374407e586d7048a3d5aac94f103f751088bf398e07cd5400" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -9128,9 +9112,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -9162,7 +9146,7 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "serde", "serde_derive", "serde_json", @@ -9286,7 +9270,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9397,9 +9381,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -9456,7 +9440,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9548,7 +9532,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-timeout", "percent-encoding", "pin-project", @@ -9613,7 +9597,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9825,9 +9809,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -9899,14 +9883,14 @@ dependencies = [ "rustls-pki-types", "rustls-webpki", "url", - "webpki-roots 0.26.1", + "webpki-roots 0.26.3", ] [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -9928,17 +9912,16 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea73390fe27785838dcbf75b91b1d84799e28f1ce71e6f372a5dc2200c80de5" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ - "atomic", "getrandom", "rand", "serde", @@ -9948,13 +9931,13 @@ dependencies = [ [[package]] name = "uuid-macro-internal" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb394c528d1cb434c2f0522027e50c0705305caf6d20405c07a6f7e4cf9543c" +checksum = "a3ff64d5cde1e2cb5268bdb497235b6bd255ba8244f910dbc3574e59593de68c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -10001,9 +9984,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec1" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb60dcfffc189bfd4e2a81333c268619fee9db53da71bce2bcbd8e129c56936" +checksum = "eab68b56840f69efb0fefbe3ab6661499217ffdc58e2eef7c3f6f69835386322" [[package]] name = "vec_map" @@ -10069,7 +10052,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -10103,7 +10086,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10129,9 +10112,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +checksum = "34e9e6b6d4a2bb4e7e69433e0b35c7923b95d4dc8503a84d25ec917a4bbfdf07" dependencies = [ "cc", "downcast-rs", @@ -10143,11 +10126,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +checksum = "1e63801c85358a431f986cffa74ba9599ff571fc5774ac113ed3b490c19a1133" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rustix 0.38.34", "wayland-backend", "wayland-scanner", @@ -10159,16 +10142,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.1" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +checksum = "a206e8b2b53b1d3fcb9428fec72bc278ce539e2fa81fe2bfc1ab27703d5187b9" dependencies = [ "rustix 0.38.34", "wayland-client", @@ -10181,7 +10164,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -10193,7 +10176,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -10206,7 +10189,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -10215,9 +10198,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +checksum = "67da50b9f80159dec0ea4c11c13e24ef9e7574bd6ce24b01860a175010cea565" dependencies = [ "proc-macro2", "quick-xml", @@ -10226,9 +10209,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "105b1842da6554f91526c14a2a2172897b7f745a805d62af4ce698706be79c12" dependencies = [ "dlib", "log", @@ -10294,9 +10277,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -10340,7 +10323,7 @@ checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg_aliases 0.1.1", "codespan-reporting", "indexmap 2.2.6", @@ -10367,7 +10350,7 @@ dependencies = [ "android_system_properties", "arrayvec", "ash", - "bitflags 2.5.0", + "bitflags 2.6.0", "block", "cfg_aliases 0.1.1", "core-graphics-types", @@ -10380,7 +10363,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.3", + "libloading 0.8.4", "log", "metal", "naga", @@ -10406,7 +10389,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "js-sys", "web-sys", ] @@ -10815,7 +10798,7 @@ dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytemuck", "calloop", "cfg_aliases 0.1.1", @@ -10901,7 +10884,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -10943,7 +10926,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.3", + "libloading 0.8.4", "once_cell", "rustix 0.38.34", "x11rb-protocol", @@ -10963,12 +10946,12 @@ checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] @@ -10977,7 +10960,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "dlib", "log", "once_cell", @@ -10986,9 +10969,9 @@ dependencies = [ [[package]] name = "xkeysym" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" @@ -11492,14 +11475,14 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zstd" diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 7d5cac89..c52d29b3 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -25,7 +25,8 @@ arrow = { workspace = true, features = ["pyarrow"] } pythonize = { workspace = true } futures = "0.3.28" dora-ros2-bridge-python = { workspace = true } -pyo3_special_method_derive = "0.2.1" +pyo3_special_method_derive = "0.3.0" +pyo3_special_method_derive_lib = "0.3.0" [lib] name = "dora" diff --git a/libraries/extensions/ros2-bridge/python/Cargo.toml b/libraries/extensions/ros2-bridge/python/Cargo.toml index 92bcad08..2889a4dd 100644 --- a/libraries/extensions/ros2-bridge/python/Cargo.toml +++ b/libraries/extensions/ros2-bridge/python/Cargo.toml @@ -12,7 +12,8 @@ eyre = "0.6" serde = "1.0.166" arrow = { workspace = true, features = ["pyarrow"] } futures = "0.3.28" -pyo3_special_method_derive = "0.2.1" +pyo3_special_method_derive = "0.3.0" +pyo3_special_method_derive_lib = "0.3.0" [dev-dependencies] serde_assert = "0.7.1"