All Versions
62
Latest Version
Avg Release Cycle
33 days
Latest Release
37 days ago

Changelog History
Page 1

  • v0.16.4 Changes

    April 14, 2022

    โž• 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
  • v0.16.3 Changes

    April 05, 2022

    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
  • v0.16.2 Changes

    March 15, 2022

    Packaging

    • Warn when modules are imported on PyPy 3.7 versions older than PyPy 7.3.8, as they are known to have binary compatibility issues. #2217
    • ๐Ÿ— Ensure build script of pyo3-ffi runs before that of pyo3 to fix cross compilation. #2224
  • v0.16.1 Changes

    March 05, 2022

    Packaging

    • ๐Ÿ‘ Extend hashbrown optional dependency supported versions to include 0.12. #2197

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix incorrect platform detection for Windows in pyo3-build-config. #2198
    • ๐Ÿ›  Fix regression from 0.16 preventing cross compiling to aarch64 macOS. #2201
  • v0.16.0 Changes

    February 27, 2022

    Packaging

    • โšก๏ธ Update MSRV to Rust 1.48. #2004
    • โšก๏ธ Update indoc optional dependency to 1.0. #2004
    • โฌ‡๏ธ Drop support for Python 3.6, remove abi3-py36 feature. #2006
    • ๐Ÿ— pyo3-build-config no longer enables the resolve-config feature by default. #2008
    • โšก๏ธ Update inventory optional dependency to 0.2. #2019
    • โฌ‡๏ธ Drop paste dependency. #2081
    • The bindings found in pyo3::ffi are now a re-export of a separate pyo3-ffi crate. #2126
    • ๐Ÿ‘Œ Support PyPy 3.9. #2143

    โž• Added

    • โž• Add PyCapsule type exposing the Capsule API. #1980
    • ๐Ÿ— Add pyo3_build_config::Sysconfigdata and supporting APIs. #1996
    • โž• Add Py::setattr method. #2009
    • โž• Add #[pyo3(crate = "some::path")] option to all attribute macros (except the deprecated #[pyproto]). #2022
    • ๐Ÿ“„ Enable create_exception! macro to take an optional docstring. #2027
    • Enable #[pyclass] for fieldless (aka C-like) enums. #2034
    • Add buffer magic methods __getbuffer__ and __releasebuffer__ to #[pymethods]. #2067
    • Add support for paths in wrap_pyfunction and wrap_pymodule. #2081
    • Enable wrap_pyfunction! to wrap a #[pyfunction] implemented in a different Rust module or crate. #2091
    • โž• Add PyAny::contains method (in operator for PyAny). #2115
    • โž• Add PyMapping::contains method (in operator for PyMapping). #2133
    • Add garbage collection magic magic methods __traverse__ and __clear__ to #[pymethods]. #2159
    • Add support for from_py_with on struct tuples and enums to override the default from-Python conversion. #2181
    • โž• Add eq, ne, lt, le, gt, ge methods to PyAny that wrap rich_compare. #2175
    • โž• Add Py::is and PyAny::is methods to check for object identity. #2183
    • Add support for the __getattribute__ magic method. #2187

    ๐Ÿ”„ Changed

    • PyType::is_subclass, PyErr::is_instance and PyAny::is_instance now operate run-time type object instead of a type known at compile-time. The old behavior is still available as PyType::is_subclass_of, PyErr::is_instance_of and PyAny::is_instance_of. #1985
    • ๐Ÿ—„ Rename some methods on PyErr (the old names are just marked deprecated for now): #2026
      • pytype -> get_type
      • pvalue -> value (and deprecate equivalent instance)
      • ptraceback -> traceback
      • from_instance -> from_value
      • into_instance -> into_value
    • ๐Ÿ“„ PyErr::new_type now takes an optional docstring and now returns PyResult<Py<PyType>> rather than a ffi::PyTypeObject pointer. #2027
    • Deprecate PyType::is_instance; it is inconsistent with other is_instance methods in PyO3. Instead of typ.is_instance(obj), use obj.is_instance(typ). #2031
    • __getitem__, __setitem__ and __delitem__ in #[pymethods] now implement both a Python mapping and sequence by default. #2065
    • ๐Ÿ‘Œ Improve performance and error messages for #[derive(FromPyObject)] for enums. #2068
    • โฌ‡๏ธ Reduce generated LLVM code size (to improve compile times) for:
    • Respect Rust privacy rules for items wrapped with wrap_pyfunction and wrap_pymodule. #2081
    • Add modulo argument to __ipow__ magic method. #2083
    • ๐Ÿ›  Fix FFI definition for _PyCFunctionFast. #2126
    • PyDateTimeAPI and PyDateTime_TimeZone_UTC are are now unsafe functions instead of statics. #2126
    • PyDateTimeAPI does not implicitly call PyDateTime_IMPORT anymore to reflect the original Python API more closely. Before the first call to PyDateTime_IMPORT a null pointer is returned. Therefore before calling any of the following FFI functions PyDateTime_IMPORT must be called to avoid undefined behaviour: #2126
      • PyDateTime_TimeZone_UTC
      • PyDate_Check
      • PyDate_CheckExact
      • PyDateTime_Check
      • PyDateTime_CheckExact
      • PyTime_Check
      • PyTime_CheckExact
      • PyDelta_Check
      • PyDelta_CheckExact
      • PyTZInfo_Check
      • PyTZInfo_CheckExact
      • PyDateTime_FromTimestamp
      • PyDate_FromTimestamp
    • Deprecate the gc option for pyclass (e.g. #[pyclass(gc)]). Just implement a __traverse__ #[pymethod]. #2159
    • The ml_meth field of PyMethodDef is now represented by the PyMethodDefPointer union. 2166
    • ๐Ÿ—„ Deprecate the #[pyproto] traits. #2173

    โœ‚ Removed

    • โœ‚ Remove all functionality deprecated in PyO3 0.14. #2007
    • โœ‚ Remove Default impl for PyMethodDef. #2166
    • โœ‚ Remove PartialEq impl for Py and PyAny (use the new is() instead). #2183

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix undefined symbol for PyObject_HasAttr on PyPy. #2025
    • ๐Ÿ›  Fix memory leak in PyErr::into_value. #2026
    • ๐Ÿ›  Fix clippy warning needless-option-as-deref in code generated by #[pyfunction] and #[pymethods]. #2040
    • ๐Ÿ›  Fix undefined behavior in PySlice::indices. #2061
    • ๐Ÿ›  Fix the wrap_pymodule! macro using the wrong name for a #[pymodule] with a #[pyo3(name = "..")] attribute. #2081
    • ๐Ÿ›  Fix magic methods in #[pymethods] accepting implementations with the wrong number of arguments. #2083
    • ๐Ÿ›  Fix panic in #[pyfunction] generated code when a required argument following an Option was not provided. #2093
    • ๐Ÿ›  Fixed undefined behaviour caused by incorrect ExactSizeIterator implementations. #2124
    • ๐Ÿ›  Fix missing FFI definition PyCMethod_New on Python 3.9 and up. #2143
    • Add missing FFI definitions _PyLong_NumBits and _PyLong_AsByteArray on PyPy. #2146
    • ๐Ÿ›  Fix memory leak in implementation of AsPyPointer for Option<T>. #2160
    • Fix FFI definition of _PyLong_NumBits to return size_t instead of c_int. #2161
    • ๐Ÿ›  Fix TypeError thrown when argument parsing failed missing the originating causes. 2177
  • v0.15.2 Changes

    April 14, 2022

    Packaging

    • ๐Ÿ‘ Backport of PyPy 3.9 support from PyO3 0.16. #2262
  • v0.15.1 Changes

    November 19, 2021

    โž• Added

    • Add implementations for Py::as_ref() and Py::into_ref() for Py<PySequence>, Py<PyIterator> and Py<PyMapping>. #1682
    • โž• Add PyTraceback type to represent and format Python tracebacks. #1977

    ๐Ÿ”„ Changed

    • ๐Ÿ‘• #[classattr] constants with a known magic method name (which is lowercase) no longer trigger lint warnings expecting constants to be uppercase. #1969

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix creating #[classattr] by functions with the name of a known magic method. #1969
    • Fix use of catch_unwind in allow_threads which can cause fatal crashes. #1989
    • ๐Ÿ›  Fix build failure on PyPy when abi3 features are activated. #1991
    • ๐Ÿ›  Fix mingw platform detection. #1993
    • Fix panic in __get__ implementation when accessing descriptor on type object. #1997
  • v0.15.0 Changes

    November 03, 2021

    Packaging

    • pyo3's Cargo.toml now advertises links = "python" to inform Cargo that it links against libpython. #1819
    • โž• Added optional anyhow feature to convert anyhow::Error into PyErr. #1822
    • ๐Ÿ‘Œ Support Python 3.10. #1889
    • โž• Added optional eyre feature to convert eyre::Report into PyErr. #1893
    • ๐Ÿ‘Œ Support PyPy 3.8. #1948

    โž• Added

    • Add PyList::get_item_unchecked and PyTuple::get_item_unchecked to get items without bounds checks. #1733
    • ๐Ÿ‘Œ Support #[doc = include_str!(...)] attributes on Rust 1.54 and up. #1746
    • โž• Add PyAny::py as a convenience for PyNativeType::py. #1751
    • โž• Add implementation of std::ops::Index<usize> for PyList, PyTuple and PySequence. #1825
    • โž• Add range indexing implementations of std::ops::Index for PyList, PyTuple and PySequence. #1829
    • โž• Add PyMapping type to represent the Python mapping protocol. #1844
    • โž• Add commonly-used sequence methods to PyList and PyTuple. #1849
    • โž• Add as_sequence methods to PyList and PyTuple. #1860
    • โž• Add support for magic methods in #[pymethods], intended as a replacement for #[pyproto]. #1864
    • โž• Add abi3-py310 feature. #1889
    • โž• Add PyCFunction::new_closure to create a Python function from a Rust closure. #1901
    • โž• Add support for positional-only arguments in #[pyfunction]. #1925
    • โž• Add PyErr::take to attempt to fetch a Python exception if present. #1957

    ๐Ÿ”„ Changed

    • PyList, PyTuple and PySequence's APIs now accepts only usize indices instead of isize. #1733, #1802, #1803
    • PyList::get_item and PyTuple::get_item now return PyResult<&PyAny> instead of panicking. #1733
    • PySequence::in_place_repeat and PySequence::in_place_concat now return PyResult<&PySequence> instead of PyResult<()>, which is needed in case of immutable sequences such as tuples. #1803
    • PySequence::get_slice now returns PyResult<&PySequence> instead of PyResult<&PyAny>. #1829
    • ๐Ÿ—„ Deprecate PyTuple::split_from. #1804
    • ๐Ÿ—„ Deprecate PyTuple::slice, new method PyTuple::get_slice added with usize indices. #1828
    • ๐Ÿ“œ Deprecate FFI definitions PyParser_SimpleParseStringFlags, PyParser_SimpleParseStringFlagsFilename, PyParser_SimpleParseFileFlags when building for Python 3.9. #1830
    • ๐Ÿ“œ Mark FFI definitions removed in Python 3.10 PyParser_ASTFromString, PyParser_ASTFromStringObject, PyParser_ASTFromFile, PyParser_ASTFromFileObject, PyParser_SimpleParseStringFlags, PyParser_SimpleParseStringFlagsFilename, PyParser_SimpleParseFileFlags, PyParser_SimpleParseString, PyParser_SimpleParseFile, Py_SymtableString, and Py_SymtableStringObject. #1830
    • ๐Ÿ—„ #[pymethods] now handles magic methods similarly to #[pyproto]. In the future, #[pyproto] may be deprecated. #1864
    • โž• Deprecate FFI definitions PySys_AddWarnOption, PySys_AddWarnOptionUnicode and PySys_HasWarnOptions. #1887
    • Deprecate #[call] attribute in favor of using fn __call__. #1929
    • Fix missing FFI definition _PyImport_FindExtensionObject on Python 3.10. #1942
    • ๐Ÿ”„ Change PyErr::fetch to panic in debug mode if no exception is present. #1957

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix building with a conda environment on Windows. #1873
    • ๐Ÿ›  Fix panic on Python 3.6 when calling Python::with_gil with Python initialized but threading not initialized. #1874
    • ๐Ÿ›  Fix incorrect linking to version-specific DLL instead of python3.dll when cross-compiling to Windows with abi3. #1880
    • ๐Ÿ›  Fix FFI definition for PyTuple_ClearFreeList incorrectly being present for Python 3.9 and up. #1887
    • ๐Ÿ›  Fix panic in generated #[derive(FromPyObject)] for enums. #1888
    • ๐Ÿ›  Fix cross-compiling to Python 3.7 builds with the "m" abi flag. #1908
    • Fix __mod__ magic method fallback to __rmod__. #1934.
    • Fix missing FFI definition _PyImport_FindExtensionObject on Python 3.10. #1942
  • v0.14.5 Changes

    September 05, 2021

    โž• Added

    • ๐Ÿ— Make pyo3_build_config::InterpreterConfig and subfields public. #1848
    • โž• Add resolve-config feature to the pyo3-build-config to control whether its build script does anything. #1856

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix 0.14.4 compile regression on s390x-unknown-linux-gnu target. #1850
  • v0.14.4 Changes

    August 29, 2021

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ Mark PyString::data as unsafe and disable it and some supporting PyUnicode FFI APIs (which depend on a C bitfield) on big-endian targets. #1834