Skip to content

Releases: PyO3/pyo3

PyO3 0.13.1

10 Jan 13:44
Compare
Choose a tag to compare

This release is a set of quality-of-life improvements and bugfixes for PyO3 0.13.0. All new functionality adds flexibility to pyo3 in rarer cases, such as fixing #[pyclass(dict)] support for the abi3 feature (on compatible Python versions). In addition, a long-overdue initiative to reconcile PyO3's ffi definitions with the current state of the upstream Python API has started. This resulted in a number of new deprecations where mismatches were found.

For full details of all changes, see the CHANGELOG.

Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:

@cecini
@dalcde
@daniil-konovalenko
@davidhewitt
@kngwyu
@konstin
@nw0
@OrangeTux

PyO3 0.13.0

22 Dec 16:10
Compare
Choose a tag to compare

The major feature for this PyO3 release is support for the CPython limited API. This is an opt-in feature when building extension modules which makes it possible for the built wheel to be installable on multiple Python versions.

As well as this, a number of other refinements, fixes, and performance improvements have been merged into this release. In particular, note that the internal "macros" crates have been renamed to pyo3-macros and pyo3-macros-backend for clarity and consistency (previously pyo3cls and pyo3-derive-backend).

For full details of all changes, see the CHANGELOG.

Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:

@AleksaC
@alex
@Askaholic
@aviramha
@birkenfeld
@daggy1234
@davidhewitt
@dvermd
@kngwyu
@konstin
@Palladinium
@roblabla
@scalexm
@Stranger6667

PyO3 0.12.4

28 Nov 20:33
Compare
Choose a tag to compare

This release fixes a reference count issue discovered in PyO3 0.12.3, present in the implementation of From<Py<T>> for PyObject. Usage of this implementation would lead to an incorrect Python reference count decrease, likely leading to use-after-free.

This regression was only present in the PyO3 0.12 series. The offending implementation was used only in one location inside the PyO3 codebase itself, though of course is likely used in downstream code. As a result, previous PyO3 versions in the 0.12 series will be yanked.

Sincerest apologies for the inconvenience.

Fixed

  • Fix reference count bug in implementation of From<Py<T>> for PyObject, a regression introduced in PyO3 0.12. #1297

PyO3 0.12.3

12 Oct 22:29
Compare
Choose a tag to compare

This release fixes support for Rust versions 1.39 through Rust 1.44, which was erroneously broken in PyO3 0.12.2. Thanks to @mtreinish for the quick bug report!

PyO3 0.12.2

12 Oct 19:55
Compare
Choose a tag to compare

This release adds the ability to specify keyword-only arguments in #[pyfunction] definitions, a new function Python::check_signals, and a couple of smaller refinements improving upon PyO3 0.12.1.

Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:

@birkenfeld
@davidhewitt
@dvermd
@kngwyu
@sebpuetz

PyO3 0.12.1

16 Sep 21:16
Compare
Choose a tag to compare

This release contains a couple of bugfixes to resolve complation issues with 0.12.0 on specific targets. Thank you to @alex and @mtreinish for the bug reports and subsequent patches.

Fixed

  • Fix building for a 32-bit Python on 64-bit Windows with a 64-bit Rust toolchain. #1179
  • Fix building on platforms where c_char is u8. #1182

PyO3 0.12.0

12 Sep 22:55
Compare
Choose a tag to compare

This release includes a few careful revisions to the PyO3 API with the intention to make it easier to learn and use. The PyErr type is reworked to implement std::error::Error. The FromPy trait is removed. Finally, the PyObject struct is now just a type alias to Py<PyAny>. While we do not take pleasure in making breaking changes for users' code, we have done so with careful thought to make migration as simple as possible while also allowing the PyO3 API to mature. Please see the migration guide for help upgrading if any of these changes affect you.

Also added is a new #[derive(FromPyObject)] macro, which enables a convenient way to accept arguments of the Python "type" Union. (See the guide entry on this new feature.)

There have been many other improvements and bugfixes too numerous to go into detail here. For the full list, see the CHANGELOG.

Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback on the way to PyO3 0.12. The full list of users who commited at least one contribution to PyO3 0.12 is below:

@alex
@birkenfeld
@cathay4t
@davidhewitt
@Hakuyume
@Hywan
@kngwyu
@konstin
@marioortizmanero
@MoritzLangenstein
@mtreinish
@mvaled
@nagisa
@noam93k
@Progdrasil
@programmerjake
@rob-thatcher
@sebpuetz
@vorner
@vthriller

PyO3 0.11.1

03 Jul 03:24
c6abf24
Compare
Choose a tag to compare

#[pyclass(unsendable)] is added, please check the guide!

[0.11.1] - 2020-06-30

Added

  • #[pyclass(unsendable)]. #1009

Changed

  • Update parking_lot dependency to 0.11. #1010

PyO3 0.11.0

28 Jun 09:14
6335a7f
Compare
Choose a tag to compare

This is our first version that supports the stable Rust toolchain. The minimum required version is 1.39.0.
Thank you @davidhewitt @scalexm @tamuhey @konstin @Nateckert @Alexander-N @m-ou-se and all issue reporters 🙂

Maybe the most influential change is now #[pyclass] requires Send. Please see the migration guide for more.

Added

  • Support stable versions of Rust (>=1.39). #969
  • Add FFI definition PyObject_AsFileDescriptor. #938
  • Add PyByteArray::data, PyByteArray::as_bytes, and PyByteArray::as_bytes_mut. #967
  • Add GILOnceCell to use in situations where lazy_static or once_cell can deadlock. #975
  • Add Py::borrow, Py::borrow_mut, Py::try_borrow, and Py::try_borrow_mut for accessing #[pyclass] values. #976
  • Add IterNextOutput and IterANextOutput for returning from __next__ / __anext__. #997

Changed

  • Simplify internals of #[pyo3(get)] attribute. (Remove the hidden API GetPropertyValue.) #934
  • Call Py_Finalize at exit to flush buffers, etc. #943
  • Add type parameter to PyBuffer. #951
  • Require Send bound for #[pyclass]. #966
  • Add Python argument to most methods on PyObject and Py<T> to ensure GIL safety. #970
  • Change signature of PyTypeObject::type_object() - now takes Python argument and returns &PyType. #970
  • Change return type of PyTuple::slice() and PyTuple::split_from() from Py<PyTuple> to &PyTuple. #970
  • Change return type of PyTuple::as_slice to &[&PyAny]. #971
  • Rename PyTypeInfo::type_object to type_object_raw, and add Python argument. #975
  • Update num-complex optional dependendency from 0.2 to 0.3. #977
  • Update num-bigint optional dependendency from 0.2 to 0.3. #978
  • #[pyproto] is re-implemented without specialization. #961
  • PyClassAlloc::alloc is renamed to PyClassAlloc::new. #990
  • #[pyproto] methods can now have return value T or PyResult<T> (previously only PyResult<T> was supported). #996
  • #[pyproto] methods can now skip annotating the return type if it is (). #998

Removed

  • Remove ManagedPyRef (unused, and needs specialization) #930

Fixed

  • Fix passing explicit None to Option<T> argument #[pyfunction] with a default value. #936
  • Fix PyClass.__new__'s not respecting subclasses when inherited by a Python class. #990
  • Fix returning Option<T> from #[pyproto] methods. #996
  • Fix accepting PyRef<Self> and PyRefMut<Self> to #[getter] and #[setter] methods. #999

PyO3 0.10.1

14 May 12:39
45cb26d
Compare
Choose a tag to compare

0.10.0 has a deadlock bug and was yanked. Thank you @davidhewitt for fixing it!

Fixed

  • Fix deadlock in Python::acquire_gil() after dropping a PyObject or Py<T>. #924