fix(deps): update rust crate pyo3 to 0.27 #104
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.23->0.27Release Notes
pyo3/pyo3 (pyo3)
v0.27.2Compare Source
Changed
PyDicton GraalPy (unsupported for now, may crash at runtime). #5653Fixed
PyDictObjecton PyPy. #5653v0.27.1Compare Source
Fixed
clippy:declare_interior_mutable_constwarning from#[pyfunction]. #5538pyo3::types::PySendResultin public API. #5539v0.27.0Compare Source
Packaging
hashbrownoptional dependency to include version 0.16. #5428num-bigintdependency minimum version to 0.4.4. #5471Added
FromPyObjectOwnedas convenient trait bound forFromPyObjectwhen the data is not borrowed from Python. #4390Borrowed::extract, same asPyAnyMethods::extract, but does not restrict the lifetime by deref. #4390experimental-inspect: basic support for#[derive(IntoPyObject)](no struct fields support yet). #5365experimental-inspect: support#[pyo3(get, set)]and#[pyclass(get_all, set_all)]. #5370PyTypeCheck::classinfo_objectthat returns an object that can be used as parameter inisinstanceorissubclass. #5387PyTypeInfoondatetime.*types even when the limited API is enabled. #5388PyTypeInfoonPyIterator,PyMappingandPySequence. #5402PyTypeInfoonPyCodewhen using the stable ABI. #5403PyTypeInfoonPyWeakrefReferencewhen using the stable ABI. #5404pyo3::sync::RwLockExttrait, analogous topyo3::sync::MutexExtfor readwrite locks. #5435PyString::from_bytes. #5437AsRef<[u8]>forPyBytes. #5445CastErrorandCastIntoError. #5468PyCapsuleMethods::pointer_checkedandPyCapsuleMethods::is_valid_checked. #5474Borrowed::cast,Borrowed::cast_exactandBorrowed::cast_unchecked. #5475jiff::civil::ISOWeekDate. #5478&Cstr,CstringandCow<Cstr>. #5482#[pyclass(skip_from_py_object)]option, to opt-out of theFromPyObject: PyClass + Cloneblanket impl. #5488PyErr::add_note. #5489FromPyObjectimpl forCow<Path>&Cow<OsStr>. #5497#[pyclass(from_py_object)]pyclass option, to opt-in to the extraction of pyclasses by value (requiresClone). #5506Changed
FromPyObjecttrait for flexibility and performance: #4390FromPyObject, to allow borrowing data from Python objects (e.g.&strfrom Pythonstr).extract_boundwithextract, which takesBorrowed<'a, 'py, PyAny>.FromPyObjectimplementations forVec<u8>and[u8; N]frombytesandbytearray. #5244#[pyfn]attribute. #5384PyTypeCheck::NAME. #5387PyTypeCheck::NAMEin favour ofPyTypeCheck::classinfo_objectwhich provides the type information at runtime. #5387PyClassGuard(Mut)andPyRef(Mut)extraction now returns an opaque Rust error #5413PyTypeInfowith#[pymodule_use]. #5414Debugrepresentation ofPyBuffer<T>. #5442experimental-inspect: change the way introspection data is emitted in the binaries to avoid a pointer indirection and simplify parsing. #5450Py<T>::dropfor the case when attached to the Python interpreter. #5454DowncastErrorandDowncastIntoErrorwithCastErrorandCastIntoError. #5468GraalPy. #5471PyAnyMethods::downcastfunctions in favour ofBound::castfunctions. #5472PyTypeCheckanunsafe trait. #5473PyCapsuleMethods:pointer(),reference(), andis_valid(). #5474PyCapsuleMethods::reference. #5474PyCapsuleMethods::namenow returnsCapsuleNamewrapper instead of&CStr. #5474import_exception_boundin favour ofimport_exception. #5480PyList::get_item_unchecked,PyTuple::get_item_unchecked, andPyTuple::get_borrowed_item_uncheckedno longer check for null values at the provided index. #5494DateTime<Local>. #5507Removed
FromPyObjectBoundtrait. #4390Fixed
wasm32-wasip2. #5368OsStrconversion for non-utf8 strings on Windows. #5444cargo vendorcaused by gitignored build artifactemscripten/pybuilddir.txt. #5456PyMethodDefinstances inside#[pyfunction]macro generated code. #5459PyObjectObFlagsAndRefcnton 32-bit Python 3.14 (doesn't exist). #5499abi3interpreters on Windows using maturin's built-in sysconfig in combination with thegenerate-import-libfeature. #5503PyModule_ExecDefandPyModule_FromDefAndSpec2on PyPy. #5529v0.26.0Compare Source
Packaging
bytesdependency to add conversions forbytes::Bytes. #5252pyo3-introspectionto pair with theexperimental-inspectfeature. #5300PYO3_BUILD_EXTENSION_MODULEnow causes the same effect as theextension-modulefeature. 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. #5343Added
#[pyo3(warn(message = "...", category = ...))]attribute for automatic warnings generation for#[pyfunction]and#[pymethods]. #4364PyMutex, available on Python 3.13 and newer. #4523PyMutex_IsLocked, available on Python 3.14 and newer. #4523PyString::from_encoded_object. #5017experimental-inspect: add basic input type annotations. #5089PyFrameObjectfrom CPython 3.13. #5154experimental-inspect: tag modules created using#[pymodule]or#[pymodule_init]functions as incomplete. #5207experimental-inspect: add basic return type support. #5208PyCode::compileandPyCodeMethods::runto create and execute code objects. #5217PyOnceLocktype for thread-safe single-initialization. #5223PyClassGuard(Mut)pyclass holders. In the future they will replacePyRef(Mut). #5233experimental-inspect: allow annotations in#[pyo3(signature)]signature attribute. #5241MutexExtfor parking_lot's/lock_apiReentrantMutex. #5258experimental-inspect: support class associated constants. #5272Bound::castfamily of functions superseding thePyAnyMethods::downcastfamily. #5289Py_VersionandPy_IsFinalizing. #5317experimental-inspect: add output type annotation for#[pyclass]. #5320experimental-inspect: support#[pyclass(eq, eq_int, ord, hash, str)]. #5338experimental-inspect: add basic support for#[derive(FromPyObject)](no struct fields support yet). #5339Python::try_attach. #5342Changed
Py_TPFLAGS_DISALLOW_INSTANTIATIONinstead of a__new__which always fails for a#[pyclass]without a#[new]on Python 3.10 and up. #4568PyModule::from_codenow defaultsfile_nameto<string>if empty. #4777PyString::from_objectin favour ofPyString::from_encoded_object. #5017abi3for a Python version newer than pyo3 supports, automatically fall back to an abi3 build for the latest supported version. #5144is_instance_oftrait bound fromPyTypeInfotoPyTypeCheck. #5146MutexExtreturn type to be an associated type. #5201PyCallArgsforPy::calland friends so they're equivalent to theirBoundcounterpart. #5206Python::with_giltoPython::attach. #5209Python::allow_threadstoPython::detach#5221GILOnceCelltype in favour ofPyOnceLock. #5223pyo3::prepare_freethreaded_pythontoPython::initialize. #5247PyMemoryErrorinto/fromio::ErrorKind::OutOfMemory. #5256GILProtected. #5285#[pyclass]docstring formatting from import time to compile time. #5286Python::attachwill now panic if the Python interpreter is in the process of shutting down. #5317PyTypeInfo::type_objectfor#[pyclass]types. #5324PyObjecttype alias forPy<PyAny>. #5325Python::with_gil_uncheckedtoPython::attach_unchecked. #5340Python::assume_gil_acquiredtoPython::assume_attached. #5354Removed
PyFrameObject. #5154EqandPartialEqimplementations onPyGetSetDefFFI definition. #5196_Py_IsCoreInitializedand_Py_InitializeMain. #5317Fixed
PyByteArray::to_vecon freethreaded build to replicate GIL-enabled "soundness". #4742bigdecimalinto Python. #5198PyBuffer<T>after the Python interpreter has been finalized. #5242experimental-inspect: better automated imports generation. #5251experimental-inspect: fix introspection of__richcmp__,__concat__,__repeat__,__inplace_concat__and__inplace_repeat__. #5273PyRef::into_super#5281Py_Exit(never returns, was()return value, now!). #5317experimental-inspect: fix handling of module members gated behind#[cfg(...)]attributes. #5318v0.25.1Compare Source
Packaging
chrono-localfeature for optional conversions for chrono'sLocaltimezone &DateTime<Local>instances. #5174Added
PyBytes_AS_STRING. #5121Changed
Py_Isfunction on GraalPy #5121Fixed
asyncdeclarations when not usingexperimental-asyncfeature. #5156FromPyObjectforuuid::Uuidon big-endian architectures. #5161v0.25.0Compare Source
Packaging
bigdecimaldependency to add conversions forbigdecimal::BigDecimal. #5011timedependency to add conversions fortimetypes. #5057cfg-ifdependency. #5110ordered_floatdependency to add conversions forordered_float::NotNanandordered_float::OrderedFloat. #5114Added
experimental-inspectfeature. #3977#[pyclass(generic)]option to support runtime generic typing. #4926OnceExt&MutexExtforparking_lot&lock_api. Use the new extension traits by enabling thearc_lock,lock_api, orparking_lotcargo features. #5044From/IntoforBorrowed<T>->Py<T>. #5054PyTzInfoconstructors. #5055PY_INVALID_STACK_EFFECT. #5064AsRef<Py<PyAny>>forPy<T>,Bound<T>andBorrowed<T>. #5071PyModule_Addandcompat::PyModule_Add. #5085Py_HashBuffer,Py_HashPointer, andPyObject_GenericHash. #5086#[pymodule_export]onconstitems in declarative modules. #5096#[pyclass(immutable_type)]option (on Python 3.14+ withabi3, or 3.10+ otherwise) for immutable type objects. #5101#[pyo3(rename_all)]support on#[derive(IntoPyObject)]. #5112PyRangewrapper. #5117Changed
datetimetypes withabi3feature enabled. #4970timezone_utcin favor ofPyTzInfo::utc. #5055PyCodeObjectis now an opaque struct on all Python versions.PyFutureFeaturesis now only defined up until Python 3.10 (it was present in CPython headers but unused in 3.11 and 3.12).PyAnyMethods::isto takeother: &Bound<T>. #5071Py::isto takeother: &Py<T>. #5071PyVisit::callto takeT: Into<Option<&Py<T>>>. #5071PyDateTime_DATE_GET_TZINFOandPyDateTime_TIME_GET_TZINFOon PyPy 3.10 and later. #5079#[track_caller]towith_gilandwith_gil_unchecked. #5109std::thread::park()instead oflibc::pause()orsleep(9999999). #5115Removed
IntoPyandToPyObjecttraits. #5010pyo3-ffi(i.e. starting with_Py) which are not referenced by public APIs:_PyLocalMonitors,_Py_GlobalMonitors,_PyCoCached,_PyCoLineInstrumentationData,_PyCoMonitoringData,_PyCompilerSrcLocation,_PyErr_StackItem. #5064PyCode_GetNumFree(PyO3 cannot support it due to knowledge of the code object). #5064AsPyPointertrait. #5071from_py_with. #5097_PyMethodWrapper_Type,_PyCoroWrapper_Type,_PyImport_FrozenBootstrap,_PyImport_FrozenStdlib,_PyImport_FrozenTest,_PyManagedBuffer_Type,_PySet_Dummy,_PyWeakref_ProxyType, and_PyWeakref_CallableProxyType. #5105PyASCIIObjectState,PyUnicode_IS_ASCII,PyUnicode_IS_COMPACT, andPyUnicode_IS_COMPACT_ASCIIon Python 3.14 and newer. #5133Fixed
#[derive(IntoPyObject, FromPyObject)]when using#[pyo3()]options recognised by only one of the two derives. #5070backports.zoneinfofor python <3.9 when converting timezones into python. #5120v0.24.2Compare Source
Fixed
unused_importslint of#[pyfunction]and#[pymethods]expanded inmacro_rulescontext. #5030PyCodeObject::_co_instrumentation_versionffi struct member on Python 3.13 for systems whereuintptr_tis not 64 bits. #5048r#identin Python bindings. #5050v0.24.1Compare Source
Added
abi3-py313feature. #4969PyAnyMethods::getattr_opt. #4978PyInt::newconstructor for all supported number types (i32, u32, i64, u64, isize, usize). #4984pyo3::sync::with_critical_section2. #4992PyCallArgsforBorrowed<'_, 'py, PyTuple>,&Bound<'py, PyTuple>, and&Py<PyTuple>. #5013Fixed
is_type_offor native types not using same specialized check asis_type_of_bound. #4981Probeclass naming issue with#[pymethods]. #4988#[pyfunction]arguments takingOption<&str>andOption<&T>(for#[pyclass]types). #5002PyString::from_objectcausing of bounds reads withencodinganderrorsparameters which are not nul-terminated. #5008cratefor#[pyfunction]. #5015v0.24.0Compare Source
Packaging
target-lexicondependency to 0.13. #4822jiffdependency to add conversions forjiffdatetime types. #4823uuiddependency to add conversions foruuid::Uuid. #4864inventoryversion to 0.3.5. #4954Added
PyIterator::sendmethod to allow sending values into a python generator. #4746PyCallArgstrait for passing arguments into the Python calling protocol. This enabled using a faster calling convention for certain types, improving performance. #4768#[pyo3(default = ...']option for#[derive(FromPyObject)]to set a default value for extracted fields of named structs. #4829#[pyo3(into_py_with = ...)]option for#[derive(IntoPyObject, IntoPyObjectRef)]. #4850PyThreadState_GetFrameandPyFrame_GetBack. #4866lastforBoundListIterator,BoundTupleIteratorandBorrowedTupleIterator. #4878Iterator::count()forPyDict,PyList,PyTuple&PySet. #4878nth,nth_back,advance_byandadvance_back_byforBoundTupleIterator#4897types.GenericAliasaspyo3::types::PyGenericAlias. #4917MutextExttrait to help avoid deadlocks with the GIL while locking astd::sync::Mutex. #4934#[pyo3(rename_all = "...")]option for#[derive(FromPyObject)]. #4941Changed
nth,nth_back,advance_byandadvance_back_byforBoundListIterator. #4810DerefToPyAnyin blanket implementations ofFrom<Py<T>>andFrom<Bound<'py, T>>forPyObject. #4593io::ErrorKind::IsADirectory/NotADirectoryto the corresponding Python exception on Rust 1.83+. #4747PyAnyMethods::calland friends now requirePyCallArgsfor their positional arguments. #4768PyObject_Vectorcall(Method)on the stable abi on 3.12+. #4853#[pyo3(from_py_with = ...)]now take a path rather than a string literal #4860PathBuf&Pathinto Pythonpathlib.Pathinstead ofPyString. #4925pthread_exittrying to acquire the GIL when the interpreter is shutting down. This mimics the Python 3.14 behavior and avoids undefined behavior and crashes. #4874Removed
DerefforPyAnyand other "native" types. #4593Fixed
PyIter_Sendto return aPySendResult. #4746Configuration
📅 Schedule: Branch creation - "on saturday at 3pm" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.