-
Notifications
You must be signed in to change notification settings - Fork 936
Description
The main steps remaining to remove GIL Refs:
For 0.22
In 0.22 the gil-refs feature will continue to be available, but with two major differences from 0.21. The deprecation warnings will be unconditional and the APIs will be gated behind the feature.
-
Upgrade all of the deprecated APIs to be gated behind the
gil-refsfeature:#[cfg_attr( not(feature = "gil-refs"), deprecated( since = "0.21.0", note = "use `Py::from_owned_ptr(py, ptr)` or `Bound::from_owned_ptr(py, ptr)` instead" ) )]
To
#[cfg(feature = "gil-refs")] #[deprecated( since = "0.21.0", note = "use `Py::from_owned_ptr(py, ptr)` or `Bound::from_owned_ptr(py, ptr)` instead" )]
-
buffer.rsfeature gate deprecated APIs forPyBuffer#4144 -
conversion.rsfeature gate deprecated APIs forPython#4173 -
conversions/num_complex.rsfeature gate deprecated APIs forPyFloatandPyComplex#4145 -
err/mod.rsfeature gate deprecated APIs forPyErrand exceptions #4136 -
exceptions.rsfeature gate deprecated APIs forPyErrand exceptions #4136 -
gil.rsfeature gate deprecated APIs forGILPool#4181 -
impl_/deprecations.rsfeature gate APIs usinginto_gil_ref(Part 2) #4166 -
instance.rsfeature gate deprecated APIs forPy#4142 -
marker.rsfeature gate APIs usinginto_gil_ref(Part 1) #4160 feature gate APIs usinginto_gil_ref(Part 2) #4166 feature gate deprecated more APIs forPy#4169 feature gateas/into_gil_refAPIs (Part 3) #4172 feature gate deprecated APIs forPython#4173 -
marshal.rsfeature gate deprecated APIs formarshal#4149 -
pycell.rssplit more impl blocks (preparation ofPyCellfeature gate) #4175 feature gatePyCell#4177 -
type_object.rsfeature gate deprecated APIs forPyType,PyTypeInfoandPySuper#4134 -
types/any.rs(Tests) portPyAnytests toBoundAPI #4140 -
types/boolobject.rsfeature gate deprecated APIs forPyBool#4159 -
types/bytearray.rsfeature gate deprecated APIs forPyBytesandPyPyByteArray#4131 -
types/bytes.rsfeature gate deprecated APIs forPyBytesandPyPyByteArray#4131 -
types/capsule.rsfeature gate deprecated APIs forPyCapsule#4112 -
types/complex.rsfeature gate deprecated APIs forPyFloatandPyComplex#4145 -
types/datetime.rsfeature gate deprecated APIs fordatetimetypes #4111 -
types/dict.rsfeature gate deprecated APIs forPyDict#4108 -
types/ellipsis.rsfeature gate deprecated APIs forPyEllipsis,PyNoneandPyNotImplemented#4132 -
types/float.rsfeature gate deprecated APIs forPyFloatandPyComplex#4145 -
types/frozenset.rsfeature gate deprecated APIs forPyFrozenSet#4118 -
types/function.rsfeature gate deprecated APIs forPyCFunction#4154 -
types/iterators.rsfeature gate deprecated APIs forPyIterator#4119 -
types/list.rsfeature gate deprecated APIs forPyList#4127 -
types/memoryview.rsfeature gate deprecated APIs forPyMemoryView#4152 -
types/module.rsfeature gate deprecated APIs forPyModule#4151 -
types/none.rsfeature gate deprecated APIs forPyEllipsis,PyNoneandPyNotImplemented#4132 -
types/notimplemented.rsfeature gate deprecated APIs forPyEllipsis,PyNoneandPyNotImplemented#4132 -
types/pysuper.rsfeature gate deprecated APIs forPyType,PyTypeInfoandPySuper#4134 -
types/sequence.rs(Tests) portPySequencetests toBoundAPI #4139 -
types/set.rsfeature gate deprecated APIs forPySet#4096 -
types/slice.rsfeature gate deprecated APIs forPySlice#4141 -
types/string.rsfeature gate deprecated APIs forPyString#4101 -
types/tuple.rsfeature gate deprecated APIs forPyTuple#4107 -
types/typeobject.rsfeature gate deprecated APIs forPyType,PyTypeInfoandPySuper#4134
-
-
Remove default implementation of
FromPyObject::extract_bound(to force users to implement it). feature gateas/into_gil_refAPIs (Part 3) #4172 -
To get 0.21 out the door I left several test suites with
#[allow(deprecated)]or#[cfg_attr(not(feature = "gil-refs"), allow(deprecated)]. We'll need to update these. I like to keep coverage high but I think for sake of practicality I'm ok if we migrate all the tests to the bound API and trust the GIL Refs API is correct by virtue of being implemented on top of the Bound API. -
Update documentation on
Pythontype
For 0.23
- Mass deletion of deprecated APIs🚀
- For
_boundvariants likePyTuple::new_bound:- Add plain variants like
PyTuple::newagain. - Add deprecation markers on
PyTuple::new_boundto nudge users to the plain versions again.
- Add plain variants like
Optional polishing tasks from #3684
- Split
PyModuleMethodsto move functionality related to creating / building new modules into aPyModuleBuilder? implementPyModuleMethods#3703 (comment) - Generic
IntoPy<Py<T>> for Bound<'_, T>? implementPyTupleMethods#3681 (comment) - Should
Borrowed<'py, 'py, T>::into_gil_refbecome public API as well? -
FromPyObjectcould gain a lifetime'ato its argument&'a Bound<'py>, allowing:- downcasting the
Boundto allowimpl FromPyObject for &Bound impl FromPyObject<'a, '_> for &'a strwithout the pool; as the lifetime of the string borrow depends on the lifetime of the input, not the GIL lifetime- would allow
PyRefandPyRefMutto store&'a Bound<'py, T>(or borrowed) and avoid reference count overhead
- downcasting the
- Update
py.None(),py.Ellipsis()andpy.NotImplemented()to returnBorrowed<'py, 'py, PyNone>(etc.) - It would be nice to accept
#[pyo3(from_py_with = "PyAnyMethods::len")](and similar)