PyO3 v0.16.4 Release Notes
Release Date: 2022-04-14 // about 1 month ago-
โ Added
- โ Add
PyTzInfoAccess
trait for safe access to time zone information. #2263 - โ Add an experimental
generate-abi3-import-lib
feature to auto-generatepython3.dll
import libraries for Windows. #2282 - Add FFI definitions for
PyDateTime_BaseTime
andPyDateTime_BaseDateTime
. #2294
๐ Changed
- ๐ Improved performance of failing calls to
FromPyObject::extract
which is common when functions accept multiple distinct types. #2279 - 0๏ธโฃ Default to "m" ABI tag when choosing
libpython
link name for CPython 3.7 on Unix. #2288 - ๐ Allow to compile "abi3" extensions without a working build host Python interpreter. #2293
๐ Fixed
- Crates depending on PyO3 can collect code coverage via LLVM instrumentation using stable Rust. #2286
- Fix segfault when calling FFI methods
PyDateTime_DATE_GET_TZINFO
orPyDateTime_TIME_GET_TZINFO
ondatetime
ortime
without a tzinfo. #2289 - ๐ Fix directory names starting with the letter
n
breaking serialization of the interpreter configuration on Windows since PyO3 0.16.3. #2299
- โ Add
Previous changes from v0.16.3
-
Packaging
- ๐ Extend
parking_lot
dependency supported versions to include 0.12. #2239
โ Added
- ๐ Add methods to
pyo3_build_config::InterpreterConfig
to run Python scripts using the configured executable. #2092 - โ Add
as_bytes
method toPy<PyBytes>
. #2235 - Add FFI definitions for
PyType_FromModuleAndSpec
,PyType_GetModule
,PyType_GetModuleState
andPyModule_AddType
. #2250 - ๐ Add
pyo3_build_config::cross_compiling_from_to
as a helper to detect when PyO3 is cross-compiling. #2253 - โ Add
#[pyclass(mapping)]
option to leave sequence slots empty in container implementations. #2265 - โ Add
PyString::intern
to enable usage of the Python's built-in string interning. #2268 - โ Add
intern!
macro which can be used to amortize the cost of creating Python strings by storing them inside aGILOnceCell
. #2269 - Add
PYO3_CROSS_PYTHON_IMPLEMENTATION
environment variable for selecting the default cross Python implementation. #2272
๐ Changed
- Allow
#[pyo3(crate = "...", text_signature = "...")]
options to be used directly in#[pyclass(crate = "...", text_signature = "...")]
. #2234 - Make
PYO3_CROSS_LIB_DIR
environment variable optional when cross compiling. #2241 - Mark
METH_FASTCALL
calling convention as limited API on Python 3.10. #2250 - ๐ Deprecate
pyo3_build_config::cross_compiling
in favour ofpyo3_build_config::cross_compiling_from_to
. #2253
๐ Fixed
- ๐ Fix
abi3-py310
feature: use Python 3.10 ABI when available instead of silently falling back to the 3.9 ABI. #2242 - ๐ Use shared linking mode when cross compiling against a Framework bundle for macOS. #2233
- Fix panic during compilation when
PYO3_CROSS_LIB_DIR
is set for some host/target combinations. #2232 - Correct dependency version for
syn
to require minimal patch version 1.0.56. #2240
- ๐ Extend