All Versions
67
Latest Version
Avg Release Cycle
36 days
Latest Release
570 days ago
Changelog History
Page 2
Changelog History
Page 2
-
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
-
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 callingdel
on a#[setter]
defined class property. #1779 - Restrict FFI definitions
PyGILState_Check
andPy_tracefunc
to the unlimited API. #1787 - โ Add missing
_type
field toPyStatus
struct definition. #1791 - โฌ๏ธ Reduce lower bound
num-complex
optional dependency to support interop withrust-numpy
andndarray
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::
inpyo3::types::datetime
which broke builds using-Z avoid-dev-deps
#1811
- โ Add
-
v0.14.2 Changes
August 09, 2021โ Added
- โ Add
indexmap
feature to addToPyObject
,IntoPy
andFromPyObject
implementations forindexmap::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 ofPython::with_gil()
to allow obtaining aPython
in scenarios wherePython::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 ofPy_ssize_t
. #1766
- โ Add
-
v0.14.1 Changes
July 04, 2021 -
v0.14.0 Changes
July 03, 2021Packaging
- โก๏ธ 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 allN
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 (andpathlib.Path
objects). #1379 #1654 - โ Add a new set of
#[pyo3(...)]
attributes to control various PyO3 macro functionality: - โ 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
andPyErr::set_cause
. #1679 - โ Add FFI definitions from
cpython/pystate.h
. #1687 - โ Add
wrap_pyfunction!
macro topyo3::prelude
. #1695
๐ Changed
- ๐ Allow only one
#[pymethods]
block per#[pyclass]
by default, to remove the dependency oninventory
. Add amultiple-pymethods
feature to opt-in the original behavior and dependency oninventory
. #1457 - ๐ Change
PyTimeAccess::get_fold
to return abool
instead of au8
. #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()
andPyCFunction::new_with_keywords()
to take&'static str
arguments rather than implicitly copying (and leaking) them. #1450 - ๐ Deprecate
PyModule::call
,PyModule::call0
,PyModule::call1
andPyModule::get
. #1492 - Add length information to
PyBufferError
s raised fromPyBuffer::copy_to_slice
andPyBuffer::copy_from_slice
. #1534 - ๐ Automatically set
-undefined
anddynamic_lookup
linker arguments on macOS with theextension-module
feature. #1539 - ๐ Deprecate
#[pyproto]
methods which are easier to implement as#[pymethods]
: #1560PyBasicProtocol::__bytes__
andPyBasicProtocol::__format__
PyContextProtocol::__enter__
andPyContextProtocol::__exit__
PyDescrProtocol::__delete__
andPyDescrProtocol::__set_name__
PyMappingProtocol::__reversed__
PyNumberProtocol::__complex__
andPyNumberProtocol::__round__
PyAsyncProtocol::__aenter__
andPyAsyncProtocol::__aexit__
- ๐ Deprecate several attributes in favor of the new
#[pyo3(...)]
options: - โฌ๏ธ 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
, andPy::from_owned_ptr_or_panic
. #1426 - โ Remove many FFI definitions which never existed in the Python C-API:
- โ Remove pyclass implementation details from
PyTypeInfo
: - 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 theabi3
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
, andWindowsError
on PyPy. #1533 - ๐ Fix unneccessary rebuilds when cycling between
cargo check
andcargo clippy
in a Python virtualenv. #1557 - ๐ Fix segfault when dereferencing
ffi::PyDateTimeAPI
without the GIL. #1563 - ๐ Fix memory leak in
FromPyObject
implementations foru128
andi128
. #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 takeOption<Py_tracefunc>
parameters. #1692 - ๐ Fix
ToPyObject
impl forHashSet
to accept non-default hashers. #1702
- โก๏ธ Update
-
v0.13.2 Changes
February 12, 2021Packaging
- ๐ 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 ofSerialize
andDeserialize
forPy<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}Iterator
s. #1699
๐ Changed
prepare_freethreaded_python
will no longer register anatexit
handler to callPy_Finalize
. This resolves a number of issues with incompatible C extensions causing crashes at finalization. #1355- Mark
PyLayout::py_init
,PyClassDict::clear_dict
, andopt_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 incorrectlyPyFunction_Code
). #1387 - Fix FFI definitions
PyMarshal_WriteObjectToString
andPyMarshal_ReadObjectFromString
as available in limited API. #1387 - ๐ Fix FFI definitions
PyListObject
and those fromfuncobject.h
as requiring non-limited API. #1387 - Fix unqualified
Result
usage inpyobject_native_type_base
. #1402 - ๐ Fix build on systems where the default Python encoding is not UTF-8. #1405
- ๐ Fix build on mingw / MSYS2. #1423