Bump pyo3 from 0.23.4 to 0.24.2
Bumps pyo3 from 0.23.4 to 0.24.2.
Release notes
Sourced from pyo3's releases.
PyO3 0.24.2
This is a small patch release containing minor bugfixes and documentation improvements, including an unused imports lint warning raised from inside PyO3's proc macros.
Thank you to the following contributors for the improvements:
@davidbrochart@davidhewitt@ddelange@decathorpe@hgmich@Icxolu@n-eq@Tpt@trim21PyO3 0.24.1
This release is a security fix for the
PyString::from_objectmethod, which passed&strdata to the Python C API without checking for a terminating nul byte. All historical PyO3 versions are affected, and we recommend you upgrade if you are usingPyString::from_object. Thank you to@vthibfor the report and@Dr-Emannfor the fix. A RUSTSEC advisory will be published shortly.Aside from the security fix, this release contains a number of other non-breaking additions:
- An
abi3-py313feature to support compiling with the Python 3.13 stable ABI.PyAnyMethods::getattr_optto get optional attributes without paying the cost of a Python exception when the attribute in question does not exist.- Constructor for
PyInt::new.with_critical_section2for locking two objects at the same time on the free-threaded build.- Fix for a PyO3 0.24.0 regression with
Option<&str>andOption<&T>(whereT: PyClass) function arguments no longer being permittedThere are also a few other small bug fixes for edge cases, mostly related to compile errors from PyO3's macro code.
Thank you to the following contributors for the improvements:
@bschoenmaeckers@davidhewitt@Dr-Emann@emmagordon@epontan@Icxolu@IvanIsCoding@jelmer@jonaspleyer@ngoldbaum@Owen-CH-Leung@Tpt@Trolldemorted@XuehaiPanPyO3 0.24.0
This release is an incremental improvement of refinements and optimizations following the new APIs established in PyO3's last few releases.
Support for
jiffdatetime conversions have been added, and also UUID conversions.
... (truncated)
Changelog
Sourced from pyo3's changelog.
[0.24.2] - 2025-04-21
Fixed
- Fix
unused_importslint of#[pyfunction]and#[pymethods]expanded inmacro_rulescontext. #5030- Fix size of
PyCodeObject::_co_instrumentation_versionffi struct member on Python 3.13 for systems whereuintptr_tis not 64 bits. #5048- Fix struct-type complex enum variant fields incorrectly exposing raw identifiers as
r#identin Python bindings. #5050[0.24.1] - 2025-03-31
Added
- Add
abi3-py313feature. #4969- Add
PyAnyMethods::getattr_opt. #4978- Add
PyInt::newconstructor for all supported number types (i32, u32, i64, u64, isize, usize). #4984- Add
pyo3::sync::with_critical_section2. #4992- Implement
PyCallArgsforBorrowed<'_, 'py, PyTuple>,&Bound<'py, PyTuple>, and&Py<PyTuple>. #5013Fixed
- Fix
is_type_offor native types not using same specialized check asis_type_of_bound. #4981- Fix
Probeclass naming issue with#[pymethods]. #4988- Fix compile failure with required
#[pyfunction]arguments takingOption<&str>andOption<&T>(for#[pyclass]types). #5002- Fix
PyString::from_objectcausing of bounds reads whithencodinganderrorsparameters which are not nul-terminated. #5008- Fix compile error when additional options follow after
cratefor#[pyfunction]. #5015[0.24.0] - 2025-03-09
Packaging
- Add supported CPython/PyPy versions to cargo package metadata. #4756
- Bump
target-lexicondependency to 0.13. #4822- Add optional
jiffdependency to add conversions forjiffdatetime types. #4823- Add optional
uuiddependency to add conversions foruuid::Uuid. #4864- Bump minimum supported
inventoryversion to 0.3.5. #4954Added
- Add
PyIterator::sendmethod to allow sending values into a python generator. #4746- Add
PyCallArgstrait for passing arguments into the Python calling protocol. This enabled using a faster calling convention for certain types, improving performance. #4768- Add
#[pyo3(default = ...']option for#[derive(FromPyObject)]to set a default value for extracted fields of named structs. #4829- Add
#[pyo3(into_py_with = ...)]option for#[derive(IntoPyObject, IntoPyObjectRef)]. #4850- Add FFI definitions
PyThreadState_GetFrameandPyFrame_GetBack. #4866- Optimize
lastforBoundListIterator,BoundTupleIteratorandBorrowedTupleIterator. #4878- Optimize
Iterator::count()forPyDict,PyList,PyTuple&PySet. #4878- Optimize
nth,nth_back,advance_byandadvance_back_byforBoundTupleIterator#4897- Add support for
types.GenericAliasaspyo3::types::PyGenericAlias. #4917- Add
MutextExttrait to help avoid deadlocks with the GIL while locking astd::sync::Mutex. #4934- Add
#[pyo3(rename_all = "...")]option for#[derive(FromPyObject)]. #4941
... (truncated)
Commits
3e6bdcerelease: 0.24.2bc26a06Unraw complex struct enum field python names (#5050)345735bdocs: Update building-and-distribution.md (#5060)5d852d9ci: release cargo crate from git tag (#5027)4197614ci: do not require changelog for ci (#5058)e876f17silenceffi-checkfor private_PyCoLineInstrumentationDataon 3.13 (#5063)a177916ci: change default Python version to 3.13 (#5048)81008e1fix clippy lint on 1.87 beta4732b60docs: add blake3-py to Examples in README.md (#5028)7b64fa1Makes Clippy beta happy (#5032)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)