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:
Add support for #[pyclass(dict)] and #[pyclass(weakref)] with the abi3 feature on Python 3.9 and up. #1342
Add FFI definitions PyOS_BeforeFork, PyOS_AfterFork_Parent, PyOS_AfterFork_Child for Python 3.7 and up. #1348
Add an auto-initialize feature to control whether PyO3 should automatically initialize an embedded Python interpreter. For compatibility this feature is enabled by default in PyO3 0.13.1, but is planned to become opt-in from PyO3 0.14.0. #1347
Add support for cross-compiling to Windows without needing PYO3_CROSS_INCLUDE_DIR. #1350
Deprecated
Deprecate FFI definitions PyEval_CallObjectWithKeywords, PyEval_CallObject, PyEval_CallFunction, PyEval_CallMethod when building for Python 3.9. #1338
Deprecate FFI definitions PyGetSetDef_DICT and PyGetSetDef_INIT which have never been in the Python API. #1341
Deprecate FFI definitions PyGen_NeedsFinalizing, PyImport_Cleanup (removed in 3.9), and PyOS_InitInterrupts (3.10). #1348
Deprecate FFI definition PyOS_AfterFork for Python 3.7 and up. #1348
Deprecate FFI definitions PyCoro_Check, PyAsyncGen_Check, and PyCoroWrapper_Check, which have never been in the Python API (for the first two, it is possible to use PyCoro_CheckExact and PyAsyncGen_CheckExact instead; these are the actual functions provided by the Python API). #1348
Deprecate FFI definitions for PyUnicode_FromUnicode, PyUnicode_AsUnicode and PyUnicode_AsUnicodeAndSize, which will be removed from 3.12 and up due to PEP 613. #1370
Removed
Remove FFI definition PyFrame_ClearFreeList when building for Python 3.9. #1341
Remove FFI definition _PyDict_Contains when building for Python 3.10. #1341
Remove FFI definitions PyGen_NeedsFinalizing and PyImport_Cleanup (for 3.9 and up), and PyOS_InitInterrupts (3.10). #1348
Fixed
Stop including Py_TRACE_REFS config setting automatically if Py_DEBUG is set on Python 3.8 and up. #1334
Remove #[deny(warnings)] attribute (and instead refuse warnings only in CI). #1340
Fix deprecation warning for missing __module__ with #[pyclass]. #1343
Correct return type of PyFrozenSet::empty to &PyFrozenSet (was incorrectly &PySet). #1351
Fix missing Py_INCREF on heap type objects on Python versions before 3.8. #1365
[0.13.0] - 2020-12-22
Packaging
Drop support for Python 3.5 (as it is now end-of-life). #1250
Bump minimum supported Rust version to 1.45. #1272
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
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)
Updates the requirements on pyo3 to permit the latest version.
Release notes
Sourced from pyo3's releases.
Changelog
Sourced from pyo3's changelog.
... (truncated)
Commits
d2e87d9
release: 0.13.169fcfad
Merge pull request #1370 from PyO3/pep-6231509b2f
Merge pull request #1371 from PyO3/maturin-abi3-windows-linker-argsde86b2c
Merge pull request #1373 from davidhewitt/use-package-version02f3d5c
Deprecate functions from PEP 623a8d8003
guide: document PYO3_NO_PYTHON on Windowsc8b290a
build: make abi3 linking work on windows1303cf6
Merge pull request #1372 from davidhewitt/deprecated-changelogaf9a58a
gil: use CARGO_PACKAGE_VERSION env var0257acf
changelog: add Deprecated sectionsDependabot 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)