Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Sep 8, 2025

This PR contains the following updates:

Package Type Update Change
pyo3 dependencies minor >=0.18,<0.19 -> >=0.18, <0.27

Release Notes

pyo3/pyo3 (pyo3)

v0.26.0

Compare Source

Packaging
  • Bump hashbrown dependency to 0.15. #​5152
  • Update MSRV to 1.74. #​5171
  • Set the same maximum supported version for alternative interpreters as for CPython. #​5192
  • Add optional bytes dependency to add conversions for bytes::Bytes. #​5252
  • Publish new crate pyo3-introspection to pair with the experimental-inspect feature. #​5300
  • The PYO3_BUILD_EXTENSION_MODULE now causes the same effect as the extension-module feature. Eventually we expect maturin and setuptools-rust to set this environment variable automatically. Users with their own build systems will need to do the same. #​5343
Added
  • Add #[pyo3(warn(message = "...", category = ...))] attribute for automatic warnings generation for #[pyfunction] and #[pymethods]. #​4364
  • Add PyMutex, available on Python 3.13 and newer. #​4523
  • Add FFI definition PyMutex_IsLocked, available on Python 3.14 and newer. #​4523
  • Add PyString::from_encoded_object. #​5017
  • experimental-inspect: add basic input type annotations. #​5089
  • Add FFI function definitions for PyFrameObject from CPython 3.13. #​5154
  • experimental-inspect: tag modules created using #[pymodule] or #[pymodule_init] functions as incomplete. #​5207
  • experimental-inspect: add basic return type support. #​5208
  • Add PyCode::compile and PyCodeMethods::run to create and execute code objects. #​5217
  • Add PyOnceLock type for thread-safe single-initialization. #​5223
  • Add PyClassGuard(Mut) pyclass holders. In the future they will replace PyRef(Mut). #​5233
  • experimental-inspect: allow annotations in #[pyo3(signature)] signature attribute. #​5241
  • Implement MutexExt for parking_lot's/lock_api ReentrantMutex. #​5258
  • experimental-inspect: support class associated constants. #​5272
  • Add Bound::cast family of functions superseding the PyAnyMethods::downcast family. #​5289
  • Add FFI definitions Py_Version and Py_IsFinalizing. #​5317
  • experimental-inspect: add output type annotation for #[pyclass]. #​5320
  • experimental-inspect: support #[pyclass(eq, eq_int, ord, hash, str)]. #​5338
  • experimental-inspect: add basic support for #[derive(FromPyObject)] (no struct fields support yet). #​5339
  • Add Python::try_attach. #​5342
Changed
  • Use Py_TPFLAGS_DISALLOW_INSTANTIATION instead of a __new__ which always fails for a #[pyclass] without a #[new] on Python 3.10 and up. #​4568
  • PyModule::from_code now defaults file_name to <string> if empty. #​4777
  • Deprecate PyString::from_object in favour of PyString::from_encoded_object. #​5017
  • When building with abi3 for a Python version newer than pyo3 supports, automatically fall back to an abi3 build for the latest supported version. #​5144
  • Change is_instance_of trait bound from PyTypeInfo to PyTypeCheck. #​5146
  • Many PyO3 proc macros now report multiple errors instead of only the first one. #​5159
  • Change MutexExt return type to be an associated type. #​5201
  • Use PyCallArgs for Py::call and friends so they're equivalent to their Bound counterpart. #​5206
  • Rename Python::with_gil to Python::attach. #​5209
  • Rename Python::allow_threads to Python::detach #​5221
  • Deprecate GILOnceCell type in favour of PyOnceLock. #​5223
  • Rename pyo3::prepare_freethreaded_python to Python::initialize. #​5247
  • Convert PyMemoryError into/from io::ErrorKind::OutOfMemory. #​5256
  • Deprecate GILProtected. #​5285
  • Move #[pyclass] docstring formatting from import time to compile time. #​5286
  • Python::attach will now panic if the Python interpreter is in the process of shutting down. #​5317
  • Add fast-path to PyTypeInfo::type_object for #[pyclass] types. #​5324
  • Deprecate PyObject type alias for Py<PyAny>. #​5325
  • Rename Python::with_gil_unchecked to Python::attach_unchecked. #​5340
  • Rename Python::assume_gil_acquired to Python::assume_attached. #​5354
Removed
  • Remove FFI definition of internals of PyFrameObject. #​5154
  • Remove Eq and PartialEq implementations on PyGetSetDef FFI definition. #​5196
  • Remove private FFI definitions _Py_IsCoreInitialized and _Py_InitializeMain. #​5317
Fixed
  • Use critical section in PyByteArray::to_vec on freethreaded build to replicate GIL-enabled "soundness". #​4742
  • Fix precision loss when converting bigdecimal into Python. #​5198
  • Don't treat win7 target as a cross-compilation. #​5210
  • WASM targets no longer require exception handling support for Python < 3.14. #​5239
  • Fix segfault when dropping PyBuffer<T> after the Python interpreter has been finalized. #​5242
  • experimental-inspect: better automated imports generation. #​5251
  • experimental-inspect: fix introspection of __richcmp__, __concat__, __repeat__, __inplace_concat__ and __inplace_repeat__. #​5273
  • fixed a leaked borrow, when converting a mutable sub class into a frozen base class using PyRef::into_super #​5281
  • Fix FFI definition Py_Exit (never returns, was () return value, now !). #​5317
  • experimental-inspect: fix handling of module members gated behind #[cfg(...)] attributes. #​5318

v0.25.1

Compare Source

Packaging
  • Add support for Windows on ARM64. #​5145
  • Add chrono-local feature for optional conversions for chrono's Local timezone & DateTime<Local> instances. #​5174
Added
  • Add FFI definition PyBytes_AS_STRING. #​5121
  • Add support for module associated consts introspection. #​5150
Changed
  • Enable "vectorcall" FFI definitions on GraalPy. #​5121
  • Use Py_Is function on GraalPy #​5121
Fixed
  • Report a better compile error for async declarations when not using experimental-async feature. #​5156
  • Fix implementation of FromPyObject for uuid::Uuid on big-endian architectures. #​5161
  • Fix segmentation faults on 32-bit x86 with Python 3.14. #​5180

v0.25.0

Compare Source

Packaging
  • Support Python 3.14.0b1. #​4811
  • Bump supported GraalPy version to 24.2. #​5116
  • Add optional bigdecimal dependency to add conversions for bigdecimal::BigDecimal. #​5011
  • Add optional time dependency to add conversions for time types. #​5057
  • Remove cfg-if dependency. #​5110
  • Add optional ordered_float dependency to add conversions for ordered_float::NotNan and ordered_float::OrderedFloat. #​5114
Added
  • Add initial type stub generation to the experimental-inspect feature. #​3977
  • Add #[pyclass(generic)] option to support runtime generic typing. #​4926
  • Implement OnceExt & MutexExt for parking_lot & lock_api. Use the new extension traits by enabling the arc_lock, lock_api, or parking_lot cargo features. #​5044
  • Implement From/Into for Borrowed<T> -> Py<T>. #​5054
  • Add PyTzInfo constructors. #​5055
  • Add FFI definition PY_INVALID_STACK_EFFECT. #​5064
  • Implement AsRef<Py<PyAny>> for Py<T>, Bound<T> and Borrowed<T>. #​5071
  • Add FFI definition PyModule_Add and compat::PyModule_Add. #​5085
  • Add FFI definitions Py_HashBuffer, Py_HashPointer, and PyObject_GenericHash. #​5086
  • Support #[pymodule_export] on const items in declarative modules. #​5096
  • Add #[pyclass(immutable_type)] option (on Python 3.14+ with abi3, or 3.10+ otherwise) for immutable type objects. #​5101
  • Support #[pyo3(rename_all)] support on #[derive(IntoPyObject)]. #​5112
  • Add PyRange wrapper. #​5117
Changed
  • Enable use of datetime types with abi3 feature enabled. #​4970
  • Deprecate timezone_utc in favor of PyTzInfo::utc. #​5055
  • Reduce visibility of some CPython implementation details: #​5064
    • The FFI definition PyCodeObject is now an opaque struct on all Python versions.
    • The FFI definition PyFutureFeatures is now only defined up until Python 3.10 (it was present in CPython headers but unused in 3.11 and 3.12).
  • Change PyAnyMethods::is to take other: &Bound<T>. #​5071
  • Change Py::is to take other: &Py<T>. #​5071
  • Change PyVisit::call to take T: Into<Option<&Py<T>>>. #​5071
  • Expose PyDateTime_DATE_GET_TZINFO and PyDateTime_TIME_GET_TZINFO on PyPy 3.10 and later. #​5079
  • Add #[track_caller] to with_gil and with_gil_unchecked. #​5109
  • Use std::thread::park() instead of libc::pause() or sleep(9999999). #​5115
Removed
  • Remove all functionality deprecated in PyO3 0.23. #​4982
  • Remove deprecated IntoPy and ToPyObject traits. #​5010
  • Remove private types from pyo3-ffi (i.e. starting with _Py) which are not referenced by public APIs: _PyLocalMonitors, _Py_GlobalMonitors, _PyCoCached, _PyCoLineInstrumentationData, _PyCoMonitoringData, _PyCompilerSrcLocation, _PyErr_StackItem. #​5064
  • Remove FFI definition PyCode_GetNumFree (PyO3 cannot support it due to knowledge of the code object). #​5064
  • Remove AsPyPointer trait. #​5071
  • Remove support for the deprecated string form of from_py_with. #​5097
  • Remove FFI definitions of private static variables: _PyMethodWrapper_Type, _PyCoroWrapper_Type, _PyImport_FrozenBootstrap, _PyImport_FrozenStdlib, _PyImport_FrozenTest, _PyManagedBuffer_Type, _PySet_Dummy, _PyWeakref_ProxyType, and _PyWeakref_CallableProxyType. #​5105
  • Remove FFI definitions PyASCIIObjectState, PyUnicode_IS_ASCII, PyUnicode_IS_COMPACT, and PyUnicode_IS_COMPACT_ASCII on Python 3.14 and newer. #​5133
Fixed
  • Correctly pick up the shared state for conda-based Python installation when reading information from sysconfigdata. #​5037
  • Fix compile failure with #[derive(IntoPyObject, FromPyObject)] when using #[pyo3()] options recognised by only one of the two derives. #​5070
  • Fix various compile errors from missing FFI definitions using certain feature combinations on PyPy and GraalPy. #​5091
  • Fallback on backports.zoneinfo for python <3.9 when converting timezones into python. #​5120

v0.24.2

Compare Source

Fixed
  • Fix unused_imports lint of #[pyfunction] and #[pymethods] expanded in macro_rules context. #​5030
  • Fix size of PyCodeObject::_co_instrumentation_version ffi struct member on Python 3.13 for systems where uintptr_t is not 64 bits. #​5048
  • Fix struct-type complex enum variant fields incorrectly exposing raw identifiers as r#ident in Python bindings. #​5050

v0.24.1

Compare Source

Added
  • Add abi3-py313 feature. #​4969
  • Add PyAnyMethods::getattr_opt. #​4978
  • Add PyInt::new constructor for all supported number types (i32, u32, i64, u64, isize, usize). #​4984
  • Add pyo3::sync::with_critical_section2. #​4992
  • Implement PyCallArgs for Borrowed<'_, 'py, PyTuple>, &Bound<'py, PyTuple>, and &Py<PyTuple>. #​5013
Fixed
  • Fix is_type_of for native types not using same specialized check as is_type_of_bound. #​4981
  • Fix Probe class naming issue with #[pymethods]. #​4988
  • Fix compile failure with required #[pyfunction] arguments taking Option<&str> and Option<&T> (for #[pyclass] types). #​5002
  • Fix PyString::from_object causing of bounds reads with encoding and errors parameters which are not nul-terminated. #​5008
  • Fix compile error when additional options follow after crate for #[pyfunction]. #​5015

v0.24.0

Compare Source

Packaging
  • Add supported CPython/PyPy versions to cargo package metadata. #​4756
  • Bump target-lexicon dependency to 0.13. #​4822
  • Add optional jiff dependency to add conversions for jiff datetime types. #​4823
  • Add optional uuid dependency to add conversions for uuid::Uuid. #​4864
  • Bump minimum supported inventory version to 0.3.5. #​4954
Added
  • Add PyIterator::send method to allow sending values into a python generator. #​4746
  • Add PyCallArgs trait 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_GetFrame and PyFrame_GetBack. #​4866
  • Optimize last for BoundListIterator, BoundTupleIterator and BorrowedTupleIterator. #​4878
  • Optimize Iterator::count() for PyDict, PyList, PyTuple & PySet. #​4878
  • Optimize nth, nth_back, advance_by and advance_back_by for BoundTupleIterator #​4897
  • Add support for types.GenericAlias as pyo3::types::PyGenericAlias. #​4917
  • Add MutextExt trait to help avoid deadlocks with the GIL while locking a std::sync::Mutex. #​4934
  • Add #[pyo3(rename_all = "...")] option for #[derive(FromPyObject)]. #​4941
Changed
  • Optimize nth, nth_back, advance_by and advance_back_by for BoundListIterator. #​4810
  • Use DerefToPyAny in blanket implementations of From<Py<T>> and From<Bound<'py, T>> for PyObject. #​4593
  • Map io::ErrorKind::IsADirectory/NotADirectory to the corresponding Python exception on Rust 1.83+. #​4747
  • PyAnyMethods::call and friends now require PyCallArgs for their positional arguments. #​4768
  • Expose FFI definitions for PyObject_Vectorcall(Method) on the stable abi on 3.12+. #​4853
  • #[pyo3(from_py_with = ...)] now take a path rather than a string literal #​4860
  • Format Python traceback in impl Debug for PyErr. #​4900
  • Convert PathBuf & Path into Python pathlib.Path instead of PyString. #​4925
  • Relax parsing of exotic Python versions. #​4949
  • PyO3 threads now hang instead of pthread_exit trying to acquire the GIL when the interpreter is shutting down. This mimics the Python 3.14 behavior and avoids undefined behavior and crashes. #​4874
Removed
  • Remove implementations of Deref for PyAny and other "native" types. #​4593
  • Remove implicit default of trailing optional arguments (see #​2935) #​4729
  • Remove the deprecated implicit eq fallback for simple enums. #​4730
Fixed
  • Correct FFI definition of PyIter_Send to return a PySendResult. #​4746
  • Fix a thread safety issue in the runtime borrow checker used by mutable pyclass instances on the free-threaded build. #​4948

v0.23.5

Compare Source

Packaging
Fixed
  • Fix thread-unsafe implementation of freelist pyclasses on the free-threaded build. #​4902
  • Re-enable a workaround for situations where CPython incorrectly does not add __builtins__ to __globals__ in code executed by Python::py_run (was removed in PyO3 0.23.0). #​4921

v0.23.4

Compare Source

Added
  • Add PyList::locked_for_each, which uses a critical section to lock the list on the free-threaded build. #​4789
  • Add pyo3_build_config::add_python_framework_link_args build script API to set rpath when using macOS system Python. #​4833
Changed
  • Use datetime.fold to distinguish ambiguous datetimes when converting to and from chrono::DateTime<Tz> (rather than erroring). #​4791
  • Optimize PyList iteration on the free-threaded build. #​4789
Fixed
  • Fix unnecessary internal py.allow_threads GIL-switch when attempting to access contents of a PyErr which originated from Python (could lead to unintended deadlocks). #​4766
  • Fix thread-unsafe access of dict internals in BoundDictIterator on the free-threaded build. #​4788
  • Fix unnecessary critical sections in BoundDictIterator on the free-threaded build. #​4788
  • Fix time-of-check to time-of-use issues with list iteration on the free-threaded build. #​4789
  • Fix chrono::DateTime<Tz> to-Python conversion when Tz is chrono_tz::Tz. #​4790
  • Fix #[pyclass] not being able to be named Probe. #​4794
  • Fix not treating cross-compilation from x64 to aarch64 on Windows as a cross-compile. #​4800
  • Fix missing struct fields on GraalPy when subclassing builtin classes. #​4802
  • Fix generating import lib for PyPy when abi3 feature is enabled. #​4806
  • Fix generating import lib for python3.13t when abi3 feature is enabled. #​4808
  • Fix compile failure for raw identifiers like r#box in derive(FromPyObject). #​4814
  • Fix compile failure for #[pyclass] enum variants with more than 12 fields. #​4832

v0.23.3

Compare Source

Packaging
  • Bump optional python3-dll-a dependency to 0.2.11. #​4749
Fixed
  • Fix unresolved symbol link failures on Windows when compiling for Python 3.13t with abi3 features enabled. #​4733
  • Fix unresolved symbol link failures on Windows when compiling for Python 3.13t using the generate-import-lib feature. #​4749
  • Fix compile-time regression in PyO3 0.23.0 where changing PYO3_CONFIG_FILE would not reconfigure PyO3 for the new interpreter. #​4758

v0.23.2

Compare Source

Added
Fixed
  • Fix compile failures when building for free-threaded Python when the abi3 or abi3-pyxx features are enabled. #​4719
  • Fix ambiguous_associated_items lint error in #[pyclass] and #[derive(IntoPyObject)] macros. #​4725

v0.23.1

Compare Source

Re-release of 0.23.0 with fixes to docs.rs build.

v0.23.0

Compare Source

Packaging
Fixed
  • Fix thread-unsafe implementation of freelist pyclasses on the free-threaded build. #​4902
  • Re-enable a workaround for situations where CPython incorrectly does not add __builtins__ to __globals__ in code executed by Python::py_run (was removed in PyO3 0.23.0). #​4921

v0.22.6: PyO3 0.22.6

Compare Source

This release corrects the check for free-threaded Python introduced in PyO3 0.22.2 to prevent users accidentally installing PyO3 packages on Python 3.13t; PyO3 0.22 does not support free-threaded Python. (Stay tuned for the 0.23 release coming very soon!)

Thanks @​minrk for the report and @​davidhewitt for the fix!

v0.22.5

Compare Source

Fixed
  • Fix regression in 0.22.4 of naming collision in __clear__ slot and clear method generated code. #​4619

v0.22.4

Compare Source

Fixed
  • Fix regression in 0.22.4 of naming collision in __clear__ slot and clear method generated code. #​4619

v0.22.3

Compare Source

Added
  • Add FFI definition PyWeakref_GetRef and compat::PyWeakref_GetRef. #​4528
Changed
  • Deprecate _borrowed methods on PyWeakRef and PyWeakrefProxy (just use the owning forms). #​4590
Fixed
  • Revert removal of private FFI function _PyLong_NumBits on Python 3.13 and later. #​4450
  • Fix __traverse__ functions for base classes not being called by subclasses created with #[pyclass(extends = ...)]. #​4563
  • Fix regression in 0.22.3 failing compiles under #![forbid(unsafe_code)]. #​4574
  • Fix create_exception macro triggering lint and compile errors due to interaction with gil-refs feature. #​4589
  • Workaround possible use-after-free in _borrowed methods on PyWeakRef and PyWeakrefProxy by leaking their contents. #​4590
  • Fix crash calling PyType_GetSlot on static types before Python 3.10. #​4599

v0.22.2

Compare Source

Packaging
  • Require opt-in to freethreaded Python using the UNSAFE_PYO3_BUILD_FREE_THREADED=1 environment variable (it is not yet supported by PyO3). #​4327
Changed
  • Use FFI function calls for reference counting on all abi3 versions. #​4324
  • #[pymodule(...)] now directly accepts all relevant #[pyo3(...)] options. #​4330
Fixed
  • Fix compile failure in declarative #[pymodule] under presence of #![no_implicit_prelude]. #​4328
  • Fix compile failure due to c-string literals on Rust < 1.79. #​4353

v0.22.1

Compare Source

Added
  • Add #[pyo3(submodule)] option for declarative #[pymodule]s. #​4301
  • Implement PartialEq<bool> for Bound<'py, PyBool>. #​4305
Fixed
  • Return NotImplemented instead of raising TypeError from generated equality method when comparing different types. #​4287
  • Handle full-path #[pyo3::prelude::pymodule] and similar for #[pyclass] and #[pyfunction] in declarative modules. #​4288
  • Fix 128-bit int regression on big-endian platforms with Python <3.13. #​4291
  • Stop generating code that will never be covered with declarative modules. #​4297
  • Fix invalid deprecation warning for trailing optional on #[setter] function. #​4304

v0.22.0

Compare Source

Packaging
  • Update heck dependency to 0.5. #​3966
  • Extend range of supported versions of chrono-tz optional dependency to include version 0.10. #​4061
  • Update MSRV to 1.63. #​4129
  • Add optional num-rational feature to add conversions with Python's fractions.Fraction. #​4148
  • Support Python 3.13. #​4184
Added
  • Add PyWeakref, PyWeakrefReference and PyWeakrefProxy. #​3835
  • Support #[pyclass] on enums that have tuple variants. #​4072
  • Add support for scientific notation in Decimal conversion. #​4079
  • Add pyo3_disable_reference_pool conditional compilation flag to avoid the overhead of the global reference pool at the cost of known limitations as explained in the performance section of the guide. #​4095
  • Add #[pyo3(constructor = (...))] to customize the generated constructors for complex enum variants. #​4158
  • Add PyType::module, which always matches Python __module__. #​4196
  • Add PyType::fully_qualified_name which matches the "fully qualified name" defined in PEP 737. #​4196
  • Add PyTypeMethods::mro and PyTypeMethods::bases. #​4197
  • Add #[pyclass(ord)] to implement ordering based on PartialOrd. #​4202
  • Implement ToPyObject and IntoPy<PyObject> for PyBackedStr and PyBackedBytes. #​4205
  • Add #[pyclass(hash)] option to implement __hash__ in terms of the Hash implementation #​4206
  • Add #[pyclass(eq)] option to generate __eq__ based on PartialEq, and #[pyclass(eq_int)] for simple enums to implement equality based on their discriminants. #​4210
  • Implement From<Bound<'py, T>> for PyClassInitializer<T>. #​4214
  • Add as_super methods to PyRef and PyRefMut for accessing the base class by reference. #​4219
  • Implement PartialEq<str> for Bound<'py, PyString>. #​4245
  • Implement PyModuleMethods::filename on PyPy. #​4249
  • Implement PartialEq<[u8]> for Bound<'py, PyBytes>. #​4250
  • Add pyo3_ffi::c_str macro to create &'static CStr on Rust versions which don't have 1.77's c"" literals. #​4255
  • Support bool conversion with numpy 2.0's numpy.bool type #​4258
  • Add PyAnyMethods::{bitnot, matmul, floor_div, rem, divmod}. #​4264
Changed
  • Change the type of PySliceIndices::slicelength and the length parameter of PySlice::indices(). #​3761
  • Deprecate implicit default for trailing optional arguments #​4078
  • Cloneing pointers into the Python heap has been moved behind the py-clone feature, as it must panic without the GIL being held as a soundness fix. #​4095
  • Add #[track_caller] to all Py<T>, Bound<'py, T> and Borrowed<'a, 'py, T> methods which can panic. #​4098
  • Change PyAnyMethods::dir to be fallible and return PyResult<Bound<'py, PyList>> (and similar for PyAny::dir). #​4100
  • The global reference pool (to track pending reference count decrements) is now initialized lazily to avoid the overhead of taking a mutex upon function entry when the functionality is not actually used. #​4178
  • Emit error messages when using weakref or dict when compiling for abi3 for Python older than 3.9. #​4194
  • Change PyType::name to always match Python __name__. #​4196
  • Remove CPython internal ffi call for complex number including: add, sub, mul, div, neg, abs, pow. Added PyAnyMethods::{abs, pos, neg} #​4201
  • Deprecate implicit integer comparison for simple enums in favor of #[pyclass(eq_int)]. #​4210
  • Set the module= attribute of declarative modules' child #[pymodule]s and #[pyclass]es. #​4213
  • Set the module option for complex enum variants from the value set on the complex enum module. #​4228
  • Respect the Python "limited API" when building for the abi3 feature on PyPy or GraalPy. #​4237
  • Optimize code generated by #[pyo3(get)] on #[pyclass] fields. #​4254
  • PyCFunction::new, PyCFunction::new_with_keywords and PyCFunction::new_closure now take &'static CStr name and doc arguments (previously was &'static str). #​4255
  • The experimental-declarative-modules feature is now stabilized and available by default. #​4257
Fixed
  • Fix panic when PYO3_CROSS_LIB_DIR is set to a missing path. #​4043
  • Fix a compile error when exporting an exception created with create_exception! living in a different Rust module using the declarative-module feature. #​4086
  • Fix FFI definitions of PY_VECTORCALL_ARGUMENTS_OFFSET and PyVectorcall_NARGS to fix a false-positive assertion. #​4104
  • Disable PyUnicode_DATA on PyPy: not exposed by PyPy. #​4116
  • Correctly handle #[pyo3(from_py_with = ...)] attribute on dunder (__magic__) method arguments instead of silently ignoring it. #​4117
  • Fix a compile error when declaring a standalone function or class method with a Python name that is a Rust keyword. #​4226
  • Fix declarative modules discarding doc comments on the mod node. #​4236
  • Fix __dict__ attribute missing for #[pyclass(dict)] instances when building for abi3 on Python 3.9. #​4251

v0.21.2

Compare Source

Changed
  • Deprecate the PySet::empty() gil-ref constructor. #​4082
Fixed
  • Fix compile error for async fn in #[pymethods] with a &self receiver and more than one additional argument. #​4035
  • Improve error message for wrong receiver type in __traverse__. #​4045
  • Fix compile error when exporting a #[pyclass] living in a different Rust module using the experimental-declarative-modules feature. #​4054
  • Fix missing_docs lint triggering on documented #[pymodule] functions. #​4067
  • Fix undefined symbol errors for extension modules on AIX (by linking libpython). #​4073

v0.21.1

Compare Source

Added
  • Implement Send and Sync for PyBackedStr and PyBackedBytes. #​4007
  • Implement Clone, Debug, PartialEq, Eq, PartialOrd, Ord and Hash implementation for PyBackedBytes and PyBackedStr, and Display for PyBackedStr. #​4020
  • Add import_exception_bound! macro to import exception types without generating GIL Ref functionality for them. #​4027
Changed
  • Emit deprecation warning for uses of GIL Refs as #[setter] function arguments. #​3998
  • Add #[inline] hints on many Bound and Borrowed methods. #​4024
Fixed
  • Handle #[pyo3(from_py_with = "")] in #[setter] methods #​3995
  • Allow extraction of &Bound in #[setter] methods. #​3998
  • Fix some uncovered code blocks emitted by #[pymodule], #[pyfunction] and #[pyclass] macros. #​4009
  • Fix typo in the panic message when a class referenced in pyo3::import_exception! does not exist. #​4012
  • Fix compile error when using an async #[pymethod] with a receiver and additional arguments. #​4015

v0.21.0

Compare Source

Added
  • Add support for GraalPy (24.0 and up). #​3247
  • Add PyMemoryView type. #​3514
  • Allow async fn in for #[pyfunction] and #[pymethods], with the experimental-async feature. #​3540 #​3588 #​3599 #​3931
  • Implement PyTypeInfo for PyEllipsis, PyNone and PyNotImplemented. #​3577
  • Support #[pyclass] on enums that have non-unit variants. #​3582
  • Support chrono feature with abi3 feature. #​3664
  • FromPyObject, IntoPy<PyObject> and ToPyObject are implemented on std::duration::Duration #​3670
  • Add PyString::to_cow. Add Py<PyString>::to_str, Py<PyString>::to_cow, and Py<PyString>::to_string_lossy, as ways to access Python string data safely beyond the GIL lifetime. #​3677
  • Add Bound<T> and Borrowed<T> smart pointers as a new API for accessing Python objects. #​3686
  • Add PyNativeType::as_borrowed to convert "GIL refs" to the new Bound smart pointer. #​3692
  • Add FromPyObject::extract_bound method, to migrate FromPyObject implementations to the Bound API. #​3706
  • Add gil-refs feature to allow continued use of the deprecated GIL Refs APIs. #​3707
  • Add methods to PyAnyMethods for binary operators (add, sub, etc.) #​3712
  • Add chrono-tz feature allowing conversion between chrono_tz::Tz and zoneinfo.ZoneInfo #​3730
  • Add FFI definition PyType_GetModuleByDef. #​3734
  • Conversion between std::time::SystemTime and datetime.datetime #​3736
  • Add Py::as_any and Py::into_any. #​3785
  • Add PyStringMethods::encode_utf8. #​3801
  • Add PyBackedStr and PyBackedBytes, as alternatives to &str and &bytes where a Python object owns the data. #​3802 #​3991
  • Allow #[pymodule] macro on Rust mod blocks, with the experimental-declarative-modules feature. #​3815
  • Implement ExactSizeIterator for set and frozenset iterators on abi3 feature. #​3849
  • Add Py::drop_ref to explicitly drop a `Py`` and immediately decrease the Python reference count if the GIL is already held. #​3871
  • Allow #[pymodule] macro on single argument functions that take &Bound<'_, PyModule>. #​3905
  • Implement FromPyObject for Cow<str>. #​3928
  • Implement Default for GILOnceCell. #​3971
  • Add PyDictMethods::into_mapping, PyListMethods::into_sequence and PyTupleMethods::into_sequence. #​3982
Changed
  • PyDict::from_sequence now takes a single argument of type &PyAny (previously took two arguments Python and PyObject). #​3532
  • Deprecate Py::is_ellipsis and PyAny::is_ellipsis in favour of any.is(py.Ellipsis()). #​3577
  • Split some PyTypeInfo functionality into new traits HasPyGilRef and PyTypeCheck. #​3600
  • Deprecate PyTryFrom and PyTryInto traits in favor of any.downcast() via the PyTypeCheck and PyTypeInfo traits. #​3601
  • Allow async methods to accept &self/&mut self #​3609
  • FromPyObject for set types now also accept frozenset objects as input. #​3632
  • FromPyObject for bool now also accepts NumPy's bool_ as input. #​3638
  • Add AsRefSource associated type to PyNativeType. #​3653
  • Rename .is_true to .is_truthy on PyAny and Py<PyAny> to clarify that the test is not based on identity with or equality to the True singleton. #​3657
  • PyType::name is now PyType::qualname whereas PyType::name efficiently accesses the full name which includes the module name. #​3660
  • The Iter(A)NextOutput types are now deprecated and __(a)next__ can directly return anything which can be converted into Python objects, i.e. awaitables do not need to be wrapped into IterANextOutput or Option any more. Option can still be used as well and returning None will trigger the fast path for __next__, stopping iteration without having to raise a StopIteration exception. #​3661
  • Implement FromPyObject on chrono::DateTime<Tz> for all Tz, not just FixedOffset and Utc. #​3663
  • Add lifetime parameter to PyTzInfoAccess trait. For the deprecated gil-ref API, the trait is now implemented for &'py PyTime and &'py PyDateTime instead of PyTime and PyDate. #​3679
  • Calls to __traverse__ become no-ops for unsendable pyclasses if on the wrong thread, thereby avoiding hard aborts at the cost of potential leakage. #​3689
  • Include PyNativeType in pyo3::prelude. #​3692
  • Improve performance of extract::<i64> (and other integer types) by avoiding call to __index__() converting the value to an integer for 3.10+. Gives performance improvement of around 30% for successful extraction. #​3742
  • Relax bound of FromPyObject for Py<T> to just T: PyTypeCheck. #​3776
  • PySet and PyFrozenSet iterators now always iterate the equivalent of iter(set). (A "fast path" with no noticeable performance benefit was removed.) #​3849
  • Move implementations of FromPyObject for &str, Cow<str>, &[u8] and Cow<[u8]> onto a temporary trait FromPyObjectBound when gil-refs feature is deactivated. #​3928
  • Deprecate GILPool, Python::with_pool, and Python::new_pool. #​3947
Removed
  • Remove all functionality deprecated in PyO3 0.19. #​3603
Fixed
  • Match PyPy 7.3.14 in removing PyPy-only symbol Py_MAX_NDIMS in favour of PyBUF_MAX_NDIM. #​3757
  • Fix segmentation fault using datetime types when an invalid datetime module is on sys.path. #​3818
  • Fix non_local_definitions lint warning triggered by many PyO3 macros. #​3901
  • Disable PyCode and PyCode_Type on PyPy: PyCode_Type is not exposed by PyPy. #​3934

v0.20.3

Compare Source

Packaging
  • Add portable-atomic dependency. #​3619
  • Check maximum version of Python at build time and for versions not yet supported require opt-in to the abi3 stable ABI by the environment variable PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1. #​3821
Fixed
  • Use portable-atomic to support platforms without 64-bit atomics. #​3619
  • Fix compilation failure with either feature enabled without experimental-inspect enabled. #​3834

v0.20.2

Compare Source

Packaging
  • Pin pyo3 and pyo3-ffi dependencies on pyo3-build-config to require the same patch version, i.e. pyo3 0.20.2 requires exactly pyo3-build-config 0.20.2. #​3721
Fixed
  • Fix compile failure when building pyo3 0.20.0 with latest pyo3-build-config 0.20.X. #​3724
  • Fix docs.rs build. #​3722

v0.20.1

Compare Source

Added
  • Add optional either feature to add conversions for either::Either<L, R> sum type. #​3456
  • Add optional smallvec feature to add conversions for smallvec::SmallVec. #​3507
  • Add take and into_inner methods to GILOnceCell #​3556
  • #[classmethod] methods can now also receive Py<PyType> as their first argument. #​3587
  • #[pyfunction(pass_module)] can now also receive Py<PyModule> as their first argument. [#​3587](https://re

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Never, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Contributor Author

renovate bot commented Sep 8, 2025

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --package [email protected] --precise 0.26.0
    Updating crates.io index
error: failed to select a version for `syn`.
    ... required by package `pyo3-macros-backend v0.26.0`
    ... which satisfies dependency `pyo3-macros-backend = "=0.26.0"` of package `pyo3-macros v0.26.0`
    ... which satisfies dependency `pyo3-macros = "=0.26.0"` of package `pyo3 v0.26.0`
    ... which satisfies dependency `pyo3 = ">=0.18, <0.27"` of package `json-stream-rs-tokenizer v0.1.0 (/tmp/renovate/repos/github/smheidrich/py-json-stream-rs-tokenizer)`
versions that meet the requirements `^2.0.59` are: 2.0.106, 2.0.105, 2.0.104, 2.0.103, 2.0.102, 2.0.101, 2.0.100, 2.0.99, 2.0.98, 2.0.97, 2.0.96, 2.0.95, 2.0.94, 2.0.93, 2.0.92, 2.0.91, 2.0.90, 2.0.89, 2.0.88, 2.0.87, 2.0.86, 2.0.85, 2.0.84, 2.0.83, 2.0.82, 2.0.81, 2.0.80, 2.0.79, 2.0.78, 2.0.77, 2.0.76, 2.0.75, 2.0.74, 2.0.73, 2.0.72, 2.0.71, 2.0.70, 2.0.69, 2.0.68, 2.0.67, 2.0.66, 2.0.65, 2.0.64, 2.0.63, 2.0.62, 2.0.61, 2.0.60, 2.0.59

all possible versions conflict with previously selected packages.

  previously selected package `syn v2.0.25`
    ... which satisfies dependency `syn = "^2"` (locked to 2.0.25) of package `pyo3-macros v0.26.0`
    ... which satisfies dependency `pyo3-macros = "=0.26.0"` of package `pyo3 v0.26.0`
    ... which satisfies dependency `pyo3 = ">=0.18, <0.27"` of package `json-stream-rs-tokenizer v0.1.0 (/tmp/renovate/repos/github/smheidrich/py-json-stream-rs-tokenizer)`

failed to select a version for `syn` which could resolve this conflict

@renovate renovate bot changed the title Update Rust crate pyo3 to >=0.18, <0.27 Update Rust crate pyo3 to >=0.18, <0.27 - autoclosed Oct 28, 2025
@renovate renovate bot closed this Oct 28, 2025
@renovate renovate bot deleted the renovate/pyo3-0.x branch October 28, 2025 22:23
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