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:
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
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
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:
Rename internal crates pyo3cls and pyo3-derive-backend to pyo3-macros and pyo3-macros-backend respectively. #1317
Added
Add support for building for CPython limited API. Opting-in to the limited API enables a single extension wheel built with PyO3 to be installable on multiple Python versions. This required a few minor changes to runtime behaviour of of PyO3 #[pyclass] types. See the migration guide for full details. #1152
Add feature flags abi3-py36, abi3-py37, abi3-py38 etc. to set the minimum Python version when using the limited API. #1263
Add argument names to TypeError messages generated by pymethod wrappers. #1212
Add FFI definitions for PEP 587 "Python Initialization Configuration". #1247
Add FFI definitions for PyEval_SetProfile and PyEval_SetTrace. #1255
Add FFI definitions for context.h functions (PyContext_New, etc). #1259
Add support for conversion between char and PyString. #1282
Add FFI definitions for PyBuffer_SizeFromFormat, PyObject_LengthHint, PyObject_CallNoArgs, PyObject_CallOneArg, PyObject_CallMethodNoArgs, PyObject_CallMethodOneArg, PyObject_VectorcallDict, and PyObject_VectorcallMethod. #1287
Add conversions between u128/i128 and PyLong for PyPy. #1310
Add Python::version() and Python::version_info() to get the running interpreter version. #1322
Changed
Change return type of PyType::name() from Cow<str> to PyResult<&str>. #1152
#[pyclass(subclass)] is now required for subclassing from Rust (was previously just required for subclassing from Python). #1152
Change PyIterator to be consistent with other native types: it is now used as &PyIterator instead of PyIterator<'a>. #1176
Change formatting of PyDowncastError messages to be closer to Python's builtin error messages. #1212
Change Debug and Display impls for PyException to be consistent with PyAny. #1275
Change Debug impl of PyErr to output more helpful information (acquiring the GIL if necessary). #1275
Rename PyTypeInfo::is_instance and PyTypeInfo::is_exact_instance to PyTypeInfo::is_type_of and PyTypeInfo::is_exact_type_of. #1278
Optimize PyAny::call0, Py::call0 and PyAny::call_method0 and Py::call_method0 on Python 3.9 and up. #1287
Deprecate Python::is_instance, Python::is_subclass, Python::release, and Python::xdecref. #1292
Require double-quotes for pyclass name argument e.g #[pyclass(name = "MyClass")]. #1303
Removed
Remove deprecated ffi definitions PyUnicode_AsUnicodeCopy, PyUnicode_GetMax, _Py_CheckRecursionLimit, PyObject_AsCharBuffer, PyObject_AsReadBuffer, PyObject_CheckReadBuffer and PyObject_AsWriteBuffer, which will be removed in Python 3.10. #1217
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 rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will 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 version` will 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 dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps pyo3 from 0.12.1 to 0.13.0.
Release notes
Sourced from pyo3's releases.
Changelog
Sourced from pyo3's changelog.
Commits
26ca1f5
Release 0.1333b3da3
Merge pull request #1328 from davidhewitt/pyproto-no-inventory9e7fa40
pyproto: use buffer slots on Python 3.9 and up5170412
Merge pull request #1332 from alex/aarch64-macos-docs5bca837
Document that macOS linker flags apply on aarch64 as well11f0442
Merge pull request #1320 from PyO3/abi3-py36-now-passes-testsdb74cc8
pypy: final fix839f13e
Use assert_ne for checking thread initializationdc2dbd6
Use #[cfg(not(Py_LIMITED_API))] for datetime APIdf3826b
Remove a redundant #cfgDependabot 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 rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will 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 version` will 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 dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)