Skip to content

deps: migrate pyo3 0.20 → 0.29#56

Open
iamalwaysuncomfortable wants to merge 1 commit into
masterfrom
deps/pyo3-0.29
Open

deps: migrate pyo3 0.20 → 0.29#56
iamalwaysuncomfortable wants to merge 1 commit into
masterfrom
deps/pyo3-0.29

Conversation

@iamalwaysuncomfortable

Copy link
Copy Markdown
Member

What

Migrates both Rust crates from pyo3 0.20.0 to 0.29.0. Mechanical migration — no architecture or Python-API changes: the dual-network cdylib design, class surface, and method signatures are unchanged.

  • Module registration → Bound<'_, PyModule> (0.21 Bound API)
  • PyObjectPy<PyAny>; into_pyIntoPyObject/into_py_any (0.23 conversion traits)
  • GIL-ref &'py PyDict/PyList helper returns → Bound
  • pyclasses extracted by value opt into #[pyclass(from_py_object)] (upstream is making the automatic Clone-based FromPyObject opt-in; without this, methods taking owned pyclass args would break in a future pyo3)
  • abi3-py37 no longer exists → wheels are now cp38-abi3; both packages declare requires-python >= 3.8

One deliberate behavior change

Vec<u8> returns (bytes()", to_bytes_raw_*) now produce Python bytesinstead oflist[int]— pyo3 0.23+ specializes byte vectors. This is the Pythonic analog of the wasm SDK'sUint8Array; facade callers already wrapped these in bytes(...)so nothing downstream changes.Vec/Vec` still map to lists. Tests updated accordingly.

Verification

  • Zero compile warnings; clippy clean on both mainnet and testnet feature sets
  • Main SDK: 876 passed / 2 skipped; sdk-abi: 8 passed; shield-swap-sdk: 79 passed — all on release builds of the migrated extensions
  • Shield-swap devnode lifecycle tier (exercises the unproven Execution/Fee/Deployment bindings end-to-end): 9/9 passed
  • Unblocks the failing dependabot pyo3 bump (#sdk-abi)

Supersedes dependabot's partial sdk-abi bump. Also enables future free-threaded (no-GIL) Python support, which pyo3 0.23+ provides.

Mechanical migration, no API or architecture changes:
- module registration to Bound<'_, PyModule>
- PyObject -> Py<PyAny>; into_py -> IntoPyObject/into_py_any
- GIL-ref &'py PyDict/PyList helpers -> Bound returns
- pyclasses extracted by value opt into from_py_object (the automatic
  Clone-based FromPyObject is becoming opt-in upstream)
- abi3-py37 no longer exists: wheels are now cp38-abi3 and both packages
  declare requires-python >= 3.8

One deliberate behavior change: Vec<u8> returns (bytes(), to_bytes_raw_*)
now map to Python bytes instead of list[int] (pyo3 0.23+ specialization) —
the Pythonic analog of wasm's Uint8Array; facade callers already wrapped
with bytes(...) so nothing downstream changes. Vec<bool>/Vec<Field> still
map to lists.

Verified: zero warnings, clippy clean both networks, main SDK 876 passed,
sdk-abi 8 passed, shield-swap 79 passed on release builds.
@iamalwaysuncomfortable

Copy link
Copy Markdown
Member Author

Integration validation on the migrated build (all local, release extensions):

tier result
main SDK -m live (real testnet reads) 21 passed, 1 skipped
main SDK -m devnode 2 passed, 1 skipped
main SDK -m slow (real proving + params) 4 passed, 2 skipped
shield-swap -m live (testnet + DEX API) 11 passed, 4 skipped (access-gated)
shield-swap -m devnode (full AMM lifecycle, unproven bindings) 9 passed

Skips identical to pre-migration runs (endpoint guards + invite-gated endpoints). Not run: shield-swap live and slow (spends funds, credential-gated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant