All Versions
67
Latest Version
Avg Release Cycle
36 days
Latest Release
569 days ago

Changelog History
Page 2

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

    August 22, 2021

    โž• Added

    • โž• Add PyString::data to access the raw bytes stored in a Python string. #1794

    ๐Ÿ›  Fixed

    • Raise AttributeError to avoid panic when calling del on a #[setter] defined class property. #1779
    • Restrict FFI definitions PyGILState_Check and Py_tracefunc to the unlimited API. #1787
    • โž• Add missing _type field to PyStatus struct definition. #1791
    • โฌ‡๏ธ Reduce lower bound num-complex optional dependency to support interop with rust-numpy and ndarray when building with the MSRV of 1.41 #1799
    • ๐Ÿ›  Fix memory leak in Python::run_code. #1806
    • ๐Ÿ›  Fix memory leak in PyModule::from_code. #1810
    • โœ‚ Remove use of pyo3:: in pyo3::types::datetime which broke builds using -Z avoid-dev-deps #1811
  • v0.14.2 Changes

    August 09, 2021

    โž• Added

    • โž• Add indexmap feature to add ToPyObject, IntoPy and FromPyObject implementations for indexmap::IndexMap. #1728
    • ๐Ÿ— Add pyo3_build_config::add_extension_module_link_args() to use in build scripts to set linker arguments (for macOS). #1755
    • Add Python::with_gil_unchecked() unsafe variation of Python::with_gil() to allow obtaining a Python in scenarios where Python::with_gil() would fail. #1769

    ๐Ÿ”„ Changed

    • PyErr::new no longer acquires the Python GIL internally. #1724
    • ๐ŸŽ Reverted PyO3 0.14.0's use of cargo:rustc-cdylib-link-arg in its build script, as Cargo unintentionally allowed crates to pass linker args to downstream crates in this way. Projects supporting macOS may need to restore .cargo/config.toml files. #1755

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix regression in 0.14.0 rejecting usage of #[doc(hidden)] on structs and functions annotated with PyO3 macros. #1722
    • ๐Ÿ›  Fix regression in 0.14.0 leading to incorrect code coverage being computed for #[pyfunction]s. #1726
    • ๐Ÿ›  Fix incorrect FFI definition of Py_Buffer on PyPy. #1737
    • ๐Ÿ›  Fix incorrect calculation of dictoffset on 32-bit Windows. #1475
    • ๐Ÿ›  Fix regression in 0.13.2 leading to linking to incorrect Python library on Windows "gnu" targets. #1759
    • ๐Ÿ›  Fix compiler warning: deny trailing semicolons in expression macro. #1762
    • Fix incorrect FFI definition of Py_DecodeLocale. The 2nd argument is now *mut Py_ssize_t instead of Py_ssize_t. #1766
  • v0.14.1 Changes

    July 04, 2021

    โž• Added

    • Implement IntoPy<PyObject> for &PathBuf and &OsString. #1721

    ๐Ÿ›  Fixed

    • Fix crashes on PyPy due to incorrect definitions of PyList_SET_ITEM. #1713
  • v0.14.0 Changes

    July 03, 2021

    Packaging

    • โšก๏ธ Update num-bigint optional dependency to 0.4. #1481
    • โšก๏ธ Update num-complex optional dependency to 0.4. #1482
    • ๐Ÿ‘ Extend hashbrown optional dependency supported versions to include 0.11. #1496
    • ๐Ÿ‘Œ Support PyPy 3.7. #1538

    โž• Added

    • Extend conversions for [T; N] to all N using const generics (on Rust 1.51 and up). #1128
    • โž• Add conversions between OsStr/ OsString and Python strings. #1379
    • โž• Add conversions between Path/ PathBuf and Python strings (and pathlib.Path objects). #1379 #1654
    • โž• Add a new set of #[pyo3(...)] attributes to control various PyO3 macro functionality:
      • #[pyo3(from_py_with = "...")] function arguments and struct fields to override the default from-Python conversion. #1411
      • #[pyo3(name = "...")] for setting Python names. #1567
      • #[pyo3(text_signature = "...")] for setting text signature. #1658
    • โž• Add FFI definition PyCFunction_CheckExact for Python 3.9 and later. #1425
    • Add FFI definition Py_IS_TYPE. #1429
    • Add FFI definition _Py_InitializeMain. #1473
    • โž• Add FFI definitions from cpython/import.h.#1475
    • โž• Add tuple and unit struct support for #[pyclass] macro. #1504
    • Add FFI definition PyDateTime_TimeZone_UTC. #1572
    • โž• Add support for #[pyclass(extends=Exception)]. #1591
    • โž• Add PyErr::cause and PyErr::set_cause. #1679
    • โž• Add FFI definitions from cpython/pystate.h. #1687
    • โž• Add wrap_pyfunction! macro to pyo3::prelude. #1695

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ Allow only one #[pymethods] block per #[pyclass] by default, to remove the dependency on inventory. Add a multiple-pymethods feature to opt-in the original behavior and dependency on inventory. #1457
    • ๐Ÿ”„ Change PyTimeAccess::get_fold to return a bool instead of a u8. #1397
    • ๐Ÿ—„ Deprecate FFI definition PyCFunction_Call for Python 3.9 and up. #1425
    • ๐Ÿ—„ Deprecate FFI definition PyModule_GetFilename. #1425
    • 0๏ธโƒฃ The auto-initialize feature is no longer enabled by default. #1443
    • Change PyCFunction::new() and PyCFunction::new_with_keywords() to take &'static str arguments rather than implicitly copying (and leaking) them. #1450
    • ๐Ÿ—„ Deprecate PyModule::call, PyModule::call0, PyModule::call1 and PyModule::get. #1492
    • Add length information to PyBufferErrors raised from PyBuffer::copy_to_slice and PyBuffer::copy_from_slice. #1534
    • ๐ŸŽ Automatically set -undefined and dynamic_lookup linker arguments on macOS with the extension-module feature. #1539
    • ๐Ÿ—„ Deprecate #[pyproto] methods which are easier to implement as #[pymethods]: #1560
      • PyBasicProtocol::__bytes__ and PyBasicProtocol::__format__
      • PyContextProtocol::__enter__ and PyContextProtocol::__exit__
      • PyDescrProtocol::__delete__ and PyDescrProtocol::__set_name__
      • PyMappingProtocol::__reversed__
      • PyNumberProtocol::__complex__ and PyNumberProtocol::__round__
      • PyAsyncProtocol::__aenter__ and PyAsyncProtocol::__aexit__
    • ๐Ÿ—„ Deprecate several attributes in favor of the new #[pyo3(...)] options:
      • #[name = "..."], replaced by #[pyo3(name = "...")] #1567
      • #[pyfn(m, "name")], replaced by #[pyfn(m)] #[pyo3(name = "...")]. #1610
      • #[pymodule(name)], replaced by #[pymodule] #[pyo3(name = "...")] #1650
      • #[text_signature = "..."], replaced by #[pyo3(text_signature = "...")]. #1658
    • โฌ‡๏ธ Reduce LLVM line counts to improve compilation times. #1604
    • No longer call PyEval_InitThreads in #[pymodule] init code. #1630
    • ๐ŸŽ Use METH_FASTCALL argument passing convention, when possible, to improve #[pyfunction] and method performance. #1619, #1660
    • Filter sysconfigdata candidates by architecture when cross-compiling. #1626

    โœ‚ Removed

    • โœ‚ Remove deprecated exception names BaseException etc. #1426
    • Remove deprecated methods Python::is_instance, Python::is_subclass, Python::release, Python::xdecref, and Py::from_owned_ptr_or_panic. #1426
    • โœ‚ Remove many FFI definitions which never existed in the Python C-API:
      • (previously deprecated) PyGetSetDef_INIT, PyGetSetDef_DICT, PyCoro_Check, PyCoroWrapper_Check, and PyAsyncGen_Check #1426
      • PyMethodDef_INIT #1426
      • PyTypeObject_INIT #1429
      • PyObject_Check, PySuper_Check, and FreeFunc #1438
      • PyModuleDef_INIT #1630
    • โœ‚ Remove pyclass implementation details from PyTypeInfo:
      • Type, DESCRIPTION, and FLAGS #1456
      • BaseType, BaseLayout, Layout, Initializer #1596
    • Remove PYO3_CROSS_INCLUDE_DIR environment variable and the associated C header parsing functionality. #1521
    • โœ‚ Remove raw_pycfunction! macro. #1619
    • โœ‚ Remove PyClassAlloc trait. #1657
    • Remove PyList::get_parked_item. #1664

    ๐Ÿ›  Fixed

    • โœ‚ Remove FFI definition PyCFunction_ClearFreeList for Python 3.9 and later. #1425
    • PYO3_CROSS_LIB_DIR enviroment variable no long required when compiling for x86-64 Python from macOS arm64 and reverse. #1428
    • Fix FFI definition _PyEval_RequestCodeExtraIndex, which took an argument of the wrong type. #1429
    • ๐Ÿ›  Fix FFI definition PyIndex_Check missing with the abi3 feature. #1436
    • ๐Ÿ›  Fix incorrect TypeError raised when keyword-only argument passed along with a positional argument in *args. #1440
    • ๐Ÿ›  Fix inability to use a named lifetime for &PyTuple of *args in #[pyfunction]. #1440
    • ๐Ÿ›  Fix use of Python argument for #[pymethods] inside macro expansions. #1505
    • No longer include __doc__ in __all__ generated for #[pymodule]. #1509
    • ๐Ÿ”ง Always use cross-compiling configuration if any of the PYO3_CROSS family of environment variables are set. #1514
    • ๐Ÿ‘Œ Support EnvironmentError, IOError, and WindowsError on PyPy. #1533
    • ๐Ÿ›  Fix unneccessary rebuilds when cycling between cargo check and cargo clippy in a Python virtualenv. #1557
    • ๐Ÿ›  Fix segfault when dereferencing ffi::PyDateTimeAPI without the GIL. #1563
    • ๐Ÿ›  Fix memory leak in FromPyObject implementations for u128 and i128. #1638
    • ๐Ÿ›  Fix #[pyclass(extends=PyDict)] leaking the dict contents on drop. #1657
    • ๐Ÿ›  Fix segfault when calling PyList::get_item with negative indices. #1668
    • Fix FFI definitions of PyEval_SetProfile/PyEval_SetTrace to take Option<Py_tracefunc> parameters. #1692
    • ๐Ÿ›  Fix ToPyObject impl for HashSet to accept non-default hashers. #1702
  • v0.13.2 Changes

    February 12, 2021

    Packaging

    • ๐Ÿ‘ Lower minimum supported Rust version to 1.41. #1421

    โž• Added

    • Add unsafe API with_embedded_python_interpreter to initalize a Python interpreter, execute a closure, and finalize the interpreter. #1355
    • โž• Add serde feature which provides implementations of Serialize and Deserialize for Py<T>. #1366
    • โž• Add FFI definition _PyCFunctionFastWithKeywords on Python 3.7 and up. #1384
    • Add PyDateTime::new_with_fold() method. #1398
    • โž• Add size_hint impls for {PyDict,PyList,PySet,PyTuple}Iterators. #1699

    ๐Ÿ”„ Changed

    • prepare_freethreaded_python will no longer register an atexit handler to call Py_Finalize. This resolves a number of issues with incompatible C extensions causing crashes at finalization. #1355
    • Mark PyLayout::py_init, PyClassDict::clear_dict, and opt_to_pyobj safe, as they do not perform any unsafe operations. #1404

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix support for using r#raw_idents as argument names in pyfunctions. #1383
    • Fix typo in FFI definition for PyFunction_GetCode (was incorrectly PyFunction_Code). #1387
    • Fix FFI definitions PyMarshal_WriteObjectToString and PyMarshal_ReadObjectFromString as available in limited API. #1387
    • ๐Ÿ›  Fix FFI definitions PyListObject and those from funcobject.h as requiring non-limited API. #1387
    • Fix unqualified Result usage in pyobject_native_type_base. #1402
    • ๐Ÿ›  Fix build on systems where the default Python encoding is not UTF-8. #1405
    • ๐Ÿ›  Fix build on mingw / MSYS2. #1423