All Versions
62
Latest Version
Avg Release Cycle
33 days
Latest Release
37 days ago
Changelog History
Page 1
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-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
-
v0.16.3 Changes
April 05, 2022Packaging
- ๐ 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
-
v0.16.2 Changes
March 15, 2022 -
v0.16.1 Changes
March 05, 2022 -
v0.16.0 Changes
February 27, 2022Packaging
- โก๏ธ 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 theresolve-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 separatepyo3-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
andwrap_pymodule
. #2081 - Enable
wrap_pyfunction!
to wrap a#[pyfunction]
implemented in a different Rust module or crate. #2091 - โ Add
PyAny::contains
method (in
operator forPyAny
). #2115 - โ Add
PyMapping::contains
method (in
operator forPyMapping
). #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 toPyAny
that wraprich_compare
. #2175 - โ Add
Py::is
andPyAny::is
methods to check for object identity. #2183 - Add support for the
__getattribute__
magic method. #2187
๐ Changed
PyType::is_subclass
,PyErr::is_instance
andPyAny::is_instance
now operate run-time type object instead of a type known at compile-time. The old behavior is still available asPyType::is_subclass_of
,PyErr::is_instance_of
andPyAny::is_instance_of
. #1985- ๐ Rename some methods on
PyErr
(the old names are just marked deprecated for now): #2026pytype
->get_type
pvalue
->value
(and deprecate equivalentinstance
)ptraceback
->traceback
from_instance
->from_value
into_instance
->into_value
- ๐
PyErr::new_type
now takes an optional docstring and now returnsPyResult<Py<PyType>>
rather than affi::PyTypeObject
pointer. #2027 - Deprecate
PyType::is_instance
; it is inconsistent with otheris_instance
methods in PyO3. Instead oftyp.is_instance(obj)
, useobj.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
andwrap_pymodule
. #2081 - Add modulo argument to
__ipow__
magic method. #2083 - ๐ Fix FFI definition for
_PyCFunctionFast
. #2126 PyDateTimeAPI
andPyDateTime_TimeZone_UTC
are are now unsafe functions instead of statics. #2126PyDateTimeAPI
does not implicitly callPyDateTime_IMPORT
anymore to reflect the original Python API more closely. Before the first call toPyDateTime_IMPORT
a null pointer is returned. Therefore before calling any of the following FFI functionsPyDateTime_IMPORT
must be called to avoid undefined behaviour: #2126PyDateTime_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 forpyclass
(e.g.#[pyclass(gc)]
). Just implement a__traverse__
#[pymethod]
. #2159 - The
ml_meth
field ofPyMethodDef
is now represented by thePyMethodDefPointer
union. 2166 - ๐ Deprecate the
#[pyproto]
traits. #2173
โ Removed
- โ Remove all functionality deprecated in PyO3 0.14. #2007
- โ Remove
Default
impl forPyMethodDef
. #2166 - โ Remove
PartialEq
impl forPy
andPyAny
(use the newis()
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 anOption
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
forOption<T>
. #2160 - Fix FFI definition of
_PyLong_NumBits
to returnsize_t
instead ofc_int
. #2161 - ๐ Fix
TypeError
thrown when argument parsing failed missing the originating causes. 2177
-
v0.15.2 Changes
April 14, 2022Packaging
- ๐ 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()
andPy::into_ref()
forPy<PySequence>
,Py<PyIterator>
andPy<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
inallow_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
- Add implementations for
-
v0.15.0 Changes
November 03, 2021Packaging
pyo3
'sCargo.toml
now advertiseslinks = "python"
to inform Cargo that it links against libpython. #1819- โ Added optional
anyhow
feature to convertanyhow::Error
intoPyErr
. #1822 - ๐ Support Python 3.10. #1889
- โ Added optional
eyre
feature to converteyre::Report
intoPyErr
. #1893 - ๐ Support PyPy 3.8. #1948
โ Added
- Add
PyList::get_item_unchecked
andPyTuple::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 forPyNativeType::py
. #1751 - โ Add implementation of
std::ops::Index<usize>
forPyList
,PyTuple
andPySequence
. #1825 - โ Add range indexing implementations of
std::ops::Index
forPyList
,PyTuple
andPySequence
. #1829 - โ Add
PyMapping
type to represent the Python mapping protocol. #1844 - โ Add commonly-used sequence methods to
PyList
andPyTuple
. #1849 - โ Add
as_sequence
methods toPyList
andPyTuple
. #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
andPySequence
's APIs now accepts onlyusize
indices instead ofisize
. #1733, #1802, #1803PyList::get_item
andPyTuple::get_item
now returnPyResult<&PyAny>
instead of panicking. #1733PySequence::in_place_repeat
andPySequence::in_place_concat
now returnPyResult<&PySequence>
instead ofPyResult<()>
, which is needed in case of immutable sequences such as tuples. #1803PySequence::get_slice
now returnsPyResult<&PySequence>
instead ofPyResult<&PyAny>
. #1829- ๐ Deprecate
PyTuple::split_from
. #1804 - ๐ Deprecate
PyTuple::slice
, new methodPyTuple::get_slice
added withusize
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
, andPy_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
andPySys_HasWarnOptions
. #1887 - Deprecate
#[call]
attribute in favor of usingfn __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 withabi3
. #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 -
v0.14.4 Changes
August 29, 2021๐ Changed
- ๐ Mark
PyString::data
asunsafe
and disable it and some supporting PyUnicode FFI APIs (which depend on a C bitfield) on big-endian targets. #1834
- ๐ Mark