Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 72 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,76 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h

<!-- towncrier release notes start -->

## [0.30.0] - 2026-10-13

### Packaging

- Drop support for Python 3.8. [#6128](https://github.com/PyO3/pyo3/pull/6128)
- Bump MSRV to 1.85. [#6459](https://github.com/PyO3/pyo3/pull/6459)
- Support `meson-python` as a build backend. [#6483](https://github.com/PyO3/pyo3/pull/6483)
- Bump minimum supported GraalPy version to 25.4. [#6491](https://github.com/PyO3/pyo3/pull/6491)
- Support Python 3.15.0 final. [#6517](https://github.com/PyO3/pyo3/pull/6517)

### Added

- Add support for `PyFrozenDict` on 3.15+ [#6174](https://github.com/PyO3/pyo3/pull/6174)
- Add `PyContext` type. [#6227](https://github.com/PyO3/pyo3/pull/6227)
- `experimental-inspect`: classes which extend their base's instance layout are now decorated with `disjoint_base` in the generated stubs, as per PEP 800. [#6362](https://github.com/PyO3/pyo3/pull/6362)
- Add methods `PyBuffer::as_slice_ptr` and `PyBuffer::as_fortran_slice_ptr`. [#6382](https://github.com/PyO3/pyo3/pull/6382)
- Implement `Copy` for `PyVisit`. [#6412](https://github.com/PyO3/pyo3/pull/6412)
- Add non-poisoning variant of `PyMutex` [#6437](https://github.com/PyO3/pyo3/pull/6437)
- Add `PyStringMethods::code_point_len`. [#6455](https://github.com/PyO3/pyo3/pull/6455)
- FFI Definitions:
- Add FFI definition `PyThread_get_thread_ident`. [#6056](https://github.com/PyO3/pyo3/pull/6056)
- Add FFI definitions for PEP 731 (`PyInitConfig`). [#6152](https://github.com/PyO3/pyo3/pull/6152)
- Add FFI definitions `PyContext_AddWatcher` and `PyContext_ClearWatcher` on Python 3.14+. [#6204](https://github.com/PyO3/pyo3/pull/6204)
- Add FFI definitions for PEP 539 ("Thread-Specific Storage" API). [#6262](https://github.com/PyO3/pyo3/pull/6262)
- Enable FFI definitions `PyObject_GC_Track` and `PyObject_GC_UnTrack` on PyPy. [#6299](https://github.com/PyO3/pyo3/pull/6299)
- Add FFI definitions `PyUnicode_DecodeMBCS`, `PyUnicode_DecodeMBCSStateful`, `PyUnicode_DecodeCodePagetateful`, `PyUnicode_AsMBCSString`, `PyUnicode_EncodeCodePage`, and `PyUnicode_Equal`. [#6349](https://github.com/PyO3/pyo3/pull/6349)
- Add FFI definitions `PyFloat_Pack{2,4,8}` and `PyFloat_Unpack{2,4,8}`. [#6350](https://github.com/PyO3/pyo3/pull/6350)
- Add FFI definitions `PyFunction_GET_CODE`, `PyFunction_GET_GLOBALS`, `PyFunction_GET_MODULE`, `PyFunction_GET_DEFAULTS`, `PyFunction_GET_KW_DEFAULTS`, `PyFunction_GET_CLOSURE`, `PyFunction_GET_ANNOTATIONS`, `PyClassMethod_Type`, `PyStaticMethod_Type`, `PyClassMethod_New`, and `PyStaticMethod_New`. [#6351](https://github.com/PyO3/pyo3/pull/6351)


### Changed

- Optimized `num-bigint` conversions on Python 3.14 and newer. [#6144](https://github.com/PyO3/pyo3/pull/6144)
- Change `#[pyclass]` to not emit `FromPyObject` implementation by default (this was previously deprecated). [#6188](https://github.com/PyO3/pyo3/pull/6188)
- Deprecate `#[pyclass(skip_from_py_object)]` option (as it is now the default). [#6188](https://github.com/PyO3/pyo3/pull/6188)
- Deprecate `pyo3_build_config::PythonAbi::from_build_env` in favor of `pyo3_build_config::PythonAbi::from_stable_abi`. [#6192](https://github.com/PyO3/pyo3/pull/6192)
- Change `pyo3_build_config::InterpreterConfig::from_sysconfigdata` to no longer select a target ABI based on the content of abi3 or abi3t cargo features (it will now always select a version-specific ABI). [#6192](https://github.com/PyO3/pyo3/pull/6192)
- Optimize PyO3's internal reference pool used for disposal of `Py<T>` values dropped when not attached to the Python interpreter. [#6200](https://github.com/PyO3/pyo3/pull/6200)
- `experimental-inspect`: Emit `__all__` for complete modules in the type stubs. [#6242](https://github.com/PyO3/pyo3/pull/6242)
- Change `PyBytes::new_with_writer` to take `&mut PyBytesWriter` instead of `&mut dyn Write`. [#6251](https://github.com/PyO3/pyo3/pull/6251)
- Change `#[pymodule_init]` to allow functions which do not take a module argument (for `experimental-inspect`, such modules are not marked `Incomplete`). [#6271](https://github.com/PyO3/pyo3/pull/6271)
- Change `#[pymodule_init]` to optionally allow functions to take a `Python<'_>` marker. [#6271](https://github.com/PyO3/pyo3/pull/6271)
- Change `#[pymodule_init]` to also allow functions which return `()` (previously only accepted `Result<T, E>`). [#6271](https://github.com/PyO3/pyo3/pull/6271)
- Change `#[pymodule_init]` on fallible functions to only accept `Result<(), E>` (previously accepted any `Result<T, E>` with arbitrary return value `T`, which was immediately discarded). [#6271](https://github.com/PyO3/pyo3/pull/6271)
- Move `pyo3::types::PyMutex` and `pyo3::types::PyMutexGuard` to `pyo3::sync`. [#6324](https://github.com/PyO3/pyo3/pull/6324)
- Add additional submodules to the `pyo3::types` module, such as `pyo3::types::dict`, which provide helper types for various Python types, similar to how `std::collections::HashMap` has a `std::collections::hash_map` submodule. Helper types exported through the submodules retain temporary deprecated aliases in `pyo3::types`. [#6324](https://github.com/PyO3/pyo3/pull/6324)
- Deprecated unsound methods of `PyBuffer`: `as_slice`, `as_mut_slice`, `as_fortran_slice`, and `as_fortran_mut_slice`. [#6381](https://github.com/PyO3/pyo3/pull/6381)
- Intern dict keys in derived `IntoPyObject` and `IntoPyObjectRef` implementations. [#6446](https://github.com/PyO3/pyo3/pull/6446)
- Make datetime `Access` traits available on abi3. [#6452](https://github.com/PyO3/pyo3/pull/6452)
- Optimize many PyO3 APIs by inlining their trivial inner functions into their generic methods. [#6474](https://github.com/PyO3/pyo3/pull/6474)

### Removed

- Removed deprecated `FromPyObject for T: PyClass + Clone` blanket implementation. [#6188](https://github.com/PyO3/pyo3/pull/6188)
- Remove all functionality deprecated in PyO3 0.28. [#6519](https://github.com/PyO3/pyo3/pull/6519)

### Fixed

- Fix possible memory leak of `#[pyclass]` types due PyO3 missing a traversal needed for the garbage collector. [#6269](https://github.com/PyO3/pyo3/pull/6269)
- Fix reference to type object receiver for `#[classmethod]` dunder methods not being kept alive for the full function call. [#6420](https://github.com/PyO3/pyo3/pull/6420)
- Fix `#[pyfunction]` being marked `METH_STATIC` since PyO3 0.28, which made `__self__` `None` and calls slower on CPython 3.11+. [#6428](https://github.com/PyO3/pyo3/pull/6428)
- Fix `jiff::Zoned` extraction for nonexistent datetimes in transition gap. [#6450](https://github.com/PyO3/pyo3/pull/6450)
- Fix cases where the default library name selected by PyO3 would not respect `Py_DEBUG` build flag. [#6454](https://github.com/PyO3/pyo3/pull/6454)
- `experimental-inspect`:
- Submodules are now re-exported from the generated stubs of their parent module, so type checkers see them as attributes of the parent like they are at runtime. [#6360](https://github.com/PyO3/pyo3/pull/6360)
- Annotate integer inputs as `SupportsIndex` and float inputs as `SupportsFloat | SupportsIndex`, so that e.g. NumPy scalars are also accepted. [#6396](https://github.com/PyO3/pyo3/pull/6396)
- Annotate `Vec<T>`, `[T; N]`, `SmallVec` and `Cow<[u8]>` inputs with `_typeshed.SupportsGetItem` and `_typeshed.SupportsLenAndGetItem` instead of `collections.abc.Sequence`, so that e.g. NumPy arrays are also accepted. [#6413](https://github.com/PyO3/pyo3/pull/6413)
- Fix a panic in stub generation when a class is named like its root module. [#6424](https://github.com/PyO3/pyo3/pull/6424)
- Fix a panic in stub generation when a default value or attribute value references a name that appears in no annotation. [#6425](https://github.com/PyO3/pyo3/pull/6425)

## [0.29.3] - 2026-09-30

### Packaging
Expand Down Expand Up @@ -2741,7 +2811,8 @@ Yanked

- Initial release

[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.29.3...HEAD
[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.30.0...HEAD
[0.30.0]: https://github.com/pyo3/pyo3/compare/v0.29.3...v0.30.0
[0.29.3]: https://github.com/pyo3/pyo3/compare/v0.29.2...v0.29.3
[0.29.2]: https://github.com/pyo3/pyo3/compare/v0.29.1...v0.29.2
[0.29.1]: https://github.com/pyo3/pyo3/compare/v0.29.0...v0.29.1
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3"
version = "0.29.3"
version = "0.30.0"
description = "Bindings to Python interpreter"
readme = "README.md"
documentation = "https://docs.rs/crate/pyo3/"
Expand Down Expand Up @@ -36,10 +36,10 @@ libc = "0.2.62"
once_cell = "1.21"

# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
pyo3-ffi = { path = "pyo3-ffi", version = "=0.29.3" }
pyo3-ffi = { path = "pyo3-ffi", version = "=0.30.0" }

# support crate for macros feature
pyo3-macros = { path = "pyo3-macros", version = "=0.29.3", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.30.0", optional = true }

# support crate for multiple-pymethods feature
inventory = { version = "0.3.5", optional = true }
Expand Down Expand Up @@ -94,7 +94,7 @@ regex = "1.12.3"
ctrlc = "3.5.2"

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "=0.29.3" }
pyo3-build-config = { path = "pyo3-build-config", version = "=0.30.0" }

[features]
default = ["macros"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ name = "string_sum"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.29.3"
pyo3 = "0.30.0"
```

**`src/lib.rs`**
Expand Down Expand Up @@ -139,7 +139,7 @@ Start a new project with `cargo new` and add `pyo3` to the `Cargo.toml` like th

```toml
[dependencies.pyo3]
version = "0.29.3"
version = "0.30.0"
# Enabling this cargo feature will cause PyO3 to start a Python interpreter on first call to `Python::attach`
features = ["auto-initialize"]
```
Expand Down
2 changes: 1 addition & 1 deletion examples/decorator/.template/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable::set("PYO3_VERSION", "0.29.3");
variable::set("PYO3_VERSION", "0.30.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/pyproject.toml", "pyproject.toml");
file::delete(".template");
2 changes: 1 addition & 1 deletion examples/maturin-starter/.template/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable::set("PYO3_VERSION", "0.29.3");
variable::set("PYO3_VERSION", "0.30.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/pyproject.toml", "pyproject.toml");
file::delete(".template");
2 changes: 1 addition & 1 deletion examples/plugin/.template/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable::set("PYO3_VERSION", "0.29.3");
variable::set("PYO3_VERSION", "0.30.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/plugin_api/Cargo.toml", "plugin_api/Cargo.toml");
file::delete(".template");
2 changes: 1 addition & 1 deletion examples/setuptools-rust-starter/.template/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable::set("PYO3_VERSION", "0.29.3");
variable::set("PYO3_VERSION", "0.30.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/setup.cfg", "setup.cfg");
file::delete(".template");
2 changes: 1 addition & 1 deletion examples/word-count/.template/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable::set("PYO3_VERSION", "0.29.3");
variable::set("PYO3_VERSION", "0.30.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/pyproject.toml", "pyproject.toml");
file::delete(".template");
4 changes: 2 additions & 2 deletions guide/src/building-and-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ An example output of doing this is shown below:

```console
$ PYO3_PRINT_CONFIG=1 cargo build
Compiling pyo3-ffi v0.29.3 (/Users/goldbaum/Documents/pyo3/pyo3-ffi)
error: failed to run custom build command for `pyo3-ffi v0.29.3 (/Users/goldbaum/Documents/pyo3/pyo3-ffi)`
Compiling pyo3-ffi v0.30.0 (/Users/goldbaum/Documents/pyo3/pyo3-ffi)
error: failed to run custom build command for `pyo3-ffi v0.30.0 (/Users/goldbaum/Documents/pyo3/pyo3-ffi)`

Caused by:
process didn't exit successfully: `/Users/goldbaum/Documents/pyo3/target/debug/build/pyo3-ffi-71f0882ba738a1f0/build-script-build` (exit status: 101)
Expand Down
1 change: 0 additions & 1 deletion newsfragments/6056.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6128.packaging.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6144.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6152.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6174.added.md

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/6188.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6188.removed.md

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/6192.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6200.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6204.added.md

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/6227.added.md

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/6242.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6251.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6262.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6269.fixed.md

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/6271.added.1.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6271.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6299.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6324.changed.1.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6324.changed.md

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/6349.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6350.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6351.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6360.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6362.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6381.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6382.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6396.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6412.added.md

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/6413.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6420.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6424.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6425.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6428.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6429.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6437.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6446.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6450.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6452.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6454.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6455.added.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6459.packaging.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6474.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6483.packaging.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6491.packaging.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6517.packaging.md

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/6519.removed.md

This file was deleted.

2 changes: 1 addition & 1 deletion pyo3-build-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-build-config"
version = "0.29.3"
version = "0.30.0"
description = "Build configuration for the PyO3 ecosystem"
authors.workspace = true
keywords.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions pyo3-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-ffi"
version = "0.29.3"
version = "0.30.0"
description = "Python-API bindings for the PyO3 ecosystem"
links = "python"
authors.workspace = true
Expand Down Expand Up @@ -44,7 +44,7 @@ generate-import-lib = ["pyo3-build-config/generate-import-lib"]
paste = "1"

[build-dependencies]
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.29.3" }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.30.0" }

[lints]
workspace = true
Expand Down
4 changes: 2 additions & 2 deletions pyo3-ffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ name = "string_sum"
crate-type = ["cdylib"]

[dependencies]
pyo3-ffi = "0.29.3"
pyo3-ffi = "0.30.0"

[build-dependencies]
# This is only necessary if you need to configure your build based on
# the Python version or the compile-time configuration for the interpreter.
pyo3_build_config = "0.29.3"
pyo3_build_config = "0.30.0"
```

If you need to use conditional compilation based on Python version or how
Expand Down
2 changes: 1 addition & 1 deletion pyo3-introspection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-introspection"
version = "0.29.3"
version = "0.30.0"
description = "Introspect dynamic libraries built with PyO3 to get metadata about the exported Python types"
authors.workspace = true
homepage.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros-backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-macros-backend"
version = "0.29.3"
version = "0.30.0"
description = "Code generation for PyO3 package"
authors.workspace = true
keywords.workspace = true
Expand Down
Loading
Loading