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-generate python3.dll import libraries for Windows. #2282
    • Add FFI definitions for PyDateTime_BaseTime and PyDateTime_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 or PyDateTime_TIME_GET_TZINFO on datetime or time 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

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 to Py<PyBytes>. #2235
    • Add FFI definitions for PyType_FromModuleAndSpec, PyType_GetModule, PyType_GetModuleState and PyModule_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 a GILOnceCell. #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 of pyo3_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