Fix Rust 1.82 compilation errors by upgrading PyO3 from 0.18 to 0.20 (#4146)
## PyO3 Upgrade to Fix Compatibility with Rust 1.82 This PR addresses a compatibility issue between `PyO3 0.18` and `Rust 1.82`, which causes compilation errors due to unexpected `cfg` condition names. When compiled with Rust 1.82, the current [PyO3 0.18](https://github.com/PyO3/pyo3/blob/v0.18.3/src/types/mod.rs#L193 ) dependency produces errors like: ``` error: unexpected `cfg` condition name: `addr_of` ``` This error occurs because of changes in how Rust handles conditional configuration checks in newer compiler versions. ## Changes in this PR: 1. Upgrades PyO3 from version 0.18 to 0.20 (the latest version compatible with pyo3-asyncio) 2. Updates generated functions to follow the required API pattern where required fields precede optional ones 3. API changes in pyo3, whereby in the new version dictionary.get_key returns a Result<Option<PyAny>> instead of Result<PyAny> in the older version. This upgrade ensures compatibility with Rust 1.82 while maintaining all existing functionality. ## Testing 1. Current protocol tests pass 2. An additional test has been included for required versus optional parameters. --------- Co-authored-by:Fahad Zubair <fahadzub@amazon.com>
Loading
Please register or sign in to comment