PyO3 v0.16.3 Release Notes

Release Date: 2022-04-05 // almost 2 years ago
  • 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