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
62 changes: 61 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,65 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h

<!-- towncrier release notes start -->

## [0.25.0] - 2025-05-14

### Packaging

- Support Python 3.14.0b1. [#4811](https://github.com/PyO3/pyo3/pull/4811)
- Bump supported GraalPy version to 24.2. [#5116](https://github.com/PyO3/pyo3/pull/5116)
- Add optional `bigdecimal` dependency to add conversions for `bigdecimal::BigDecimal`. [#5011](https://github.com/PyO3/pyo3/pull/5011)
- Add optional `time` dependency to add conversions for `time` types. [#5057](https://github.com/PyO3/pyo3/pull/5057)
- Remove `cfg-if` dependency. [#5110](https://github.com/PyO3/pyo3/pull/5110)
- Add optional `ordered_float` dependency to add conversions for `ordered_float::NotNan` and `ordered_float::OrderedFloat`. [#5114](https://github.com/PyO3/pyo3/pull/5114)

### Added

- Add initial type stub generation to the `experimental-inspect` feature. [#3977](https://github.com/PyO3/pyo3/pull/3977)
- Add `#[pyclass(generic)]` option to support runtime generic typing. [#4926](https://github.com/PyO3/pyo3/pull/4926)
- Implement `OnceExt` & `MutexExt` for `parking_lot` & `lock_api`. Use the new extension traits by enabling the `arc_lock`, `lock_api`, or `parking_lot` cargo features. [#5044](https://github.com/PyO3/pyo3/pull/5044)
- Implement `From`/`Into` for `Borrowed<T>` -> `Py<T>`. [#5054](https://github.com/PyO3/pyo3/pull/5054)
- Add `PyTzInfo` constructors. [#5055](https://github.com/PyO3/pyo3/pull/5055)
- Add FFI definition `PY_INVALID_STACK_EFFECT`. [#5064](https://github.com/PyO3/pyo3/pull/5064)
- Implement `AsRef<Py<PyAny>>` for `Py<T>`, `Bound<T>` and `Borrowed<T>`. [#5071](https://github.com/PyO3/pyo3/pull/5071)
- Add FFI definition `PyModule_Add` and `compat::PyModule_Add`. [#5085](https://github.com/PyO3/pyo3/pull/5085)
- Add FFI definitions `Py_HashBuffer`, `Py_HashPointer`, and `PyObject_GenericHash`. [#5086](https://github.com/PyO3/pyo3/pull/5086)
- Support `#[pymodule_export]` on `const` items in declarative modules. [#5096](https://github.com/PyO3/pyo3/pull/5096)
- Add `#[pyclass(immutable_type)]` option (on Python 3.14+ with `abi3`, or 3.10+ otherwise) for immutable type objects. [#5101](https://github.com/PyO3/pyo3/pull/5101)
- Support `#[pyo3(rename_all)]` support on `#[derive(IntoPyObject)]`. [#5112](https://github.com/PyO3/pyo3/pull/5112)
- Add `PyRange` wrapper. [#5117](https://github.com/PyO3/pyo3/pull/5117)

### Changed

- Enable use of `datetime` types with `abi3` feature enabled. [#4970](https://github.com/PyO3/pyo3/pull/4970)
- Deprecate `timezone_utc` in favor of `PyTzInfo::utc`. [#5055](https://github.com/PyO3/pyo3/pull/5055)
- Reduce visibility of some CPython implementation details: [#5064](https://github.com/PyO3/pyo3/pull/5064)
- The FFI definition `PyCodeObject` is now an opaque struct on all Python versions.
- The FFI definition `PyFutureFeatures` is now only defined up until Python 3.10 (it was present in CPython headers but unused in 3.11 and 3.12).
- Change `PyAnyMethods::is` to take `other: &Bound<T>`. [#5071](https://github.com/PyO3/pyo3/pull/5071)
- Change `Py::is` to take `other: &Py<T>`. [#5071](https://github.com/PyO3/pyo3/pull/5071)
- Change `PyVisit::call` to take `T: Into<Option<&Py<T>>>`. [#5071](https://github.com/PyO3/pyo3/pull/5071)
- Expose `PyDateTime_DATE_GET_TZINFO` and `PyDateTime_TIME_GET_TZINFO` on PyPy 3.10 and later. [#5079](https://github.com/PyO3/pyo3/pull/5079)
- Add `#[track_caller]` to `with_gil` and `with_gil_unchecked`. [#5109](https://github.com/PyO3/pyo3/pull/5109)
- Use `std::thread::park()` instead of `libc::pause()` or `sleep(9999999)`. [#5115](https://github.com/PyO3/pyo3/pull/5115)

### Removed

- Remove all functionality deprecated in PyO3 0.23. [#4982](https://github.com/PyO3/pyo3/pull/4982)
- Remove deprecated `IntoPy` and `ToPyObject` traits. [#5010](https://github.com/PyO3/pyo3/pull/5010)
- Remove private types from `pyo3-ffi` (i.e. starting with `_Py`) which are not referenced by public APIs: `_PyLocalMonitors`, `_Py_GlobalMonitors`, `_PyCoCached`, `_PyCoLineInstrumentationData`, `_PyCoMonitoringData`, `_PyCompilerSrcLocation`, `_PyErr_StackItem`. [#5064](https://github.com/PyO3/pyo3/pull/5064)
- Remove FFI definition `PyCode_GetNumFree` (PyO3 cannot support it due to knowledge of the code object). [#5064](https://github.com/PyO3/pyo3/pull/5064)
- Remove `AsPyPointer` trait. [#5071](https://github.com/PyO3/pyo3/pull/5071)
- Remove support for the deprecated string form of `from_py_with`. [#5097](https://github.com/PyO3/pyo3/pull/5097)
- Remove FFI definitions of private static variables: `_PyMethodWrapper_Type`, `_PyCoroWrapper_Type`, `_PyImport_FrozenBootstrap`, `_PyImport_FrozenStdlib`, `_PyImport_FrozenTest`, `_PyManagedBuffer_Type`, `_PySet_Dummy`, `_PyWeakref_ProxyType`, and `_PyWeakref_CallableProxyType`. [#5105](https://github.com/PyO3/pyo3/pull/5105)
- Remove FFI definitions `PyASCIIObjectState`, `PyUnicode_IS_ASCII`, `PyUnicode_IS_COMPACT`, and `PyUnicode_IS_COMPACT_ASCII` on Python 3.14 and newer. [#5133](https://github.com/PyO3/pyo3/pull/5133)

### Fixed

- Correctly pick up the shared state for conda-based Python installation when reading information from sysconfigdata. [#5037](https://github.com/PyO3/pyo3/pull/5037)
- Fix compile failure with `#[derive(IntoPyObject, FromPyObject)]` when using `#[pyo3()]` options recognised by only one of the two derives. [#5070](https://github.com/PyO3/pyo3/pull/5070)
- Fix various compile errors from missing FFI definitions using certain feature combinations on PyPy and GraalPy. [#5091](https://github.com/PyO3/pyo3/pull/5091)
- Fallback on `backports.zoneinfo` for python <3.9 when converting timezones into python. [#5120](https://github.com/PyO3/pyo3/pull/5120)

## [0.24.2] - 2025-04-21

### Fixed
Expand Down Expand Up @@ -2139,7 +2198,8 @@ Yanked

- Initial release

[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.24.2...HEAD
[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.25.0...HEAD
[0.25.0]: https://github.com/pyo3/pyo3/compare/v0.24.2...v0.25.0
[0.24.2]: https://github.com/pyo3/pyo3/compare/v0.24.1...v0.24.2
[0.24.1]: https://github.com/pyo3/pyo3/compare/v0.24.0...v0.24.1
[0.24.0]: https://github.com/pyo3/pyo3/compare/v0.23.5...v0.24.0
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.25.0-dev"
version = "0.25.0"
description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md"
Expand All @@ -20,10 +20,10 @@ memoffset = "0.9"
once_cell = "1.13"

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

# support crates for macros feature
pyo3-macros = { path = "pyo3-macros", version = "=0.25.0-dev", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.25.0", optional = true }
indoc = { version = "2.0.1", optional = true }
unindent = { version = "0.2.1", optional = true }

Expand Down Expand Up @@ -73,7 +73,7 @@ uuid = { version = "1.10.0", features = ["v4"] }
parking_lot = { version = "0.12.3", features = ["arc_lock"]}

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "=0.25.0-dev", features = ["resolve-config"] }
pyo3-build-config = { path = "pyo3-build-config", version = "=0.25.0", features = ["resolve-config"] }

[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 = { version = "0.24.2", features = ["extension-module"] }
pyo3 = { version = "0.25.0", features = ["extension-module"] }
```

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

```toml
[dependencies.pyo3]
version = "0.24.2"
version = "0.25.0"
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.24.2");
variable::set("PYO3_VERSION", "0.25.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.24.2");
variable::set("PYO3_VERSION", "0.25.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.24.2");
variable::set("PYO3_VERSION", "0.25.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.24.2");
variable::set("PYO3_VERSION", "0.25.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.24.2");
variable::set("PYO3_VERSION", "0.25.0");
file::rename(".template/Cargo.toml", "Cargo.toml");
file::rename(".template/pyproject.toml", "pyproject.toml");
file::delete(".template");
1 change: 0 additions & 1 deletion newsfragments/3977.added.md

This file was deleted.

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

This file was deleted.

4 changes: 0 additions & 4 deletions newsfragments/4926.added.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/5064.removed.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/5133.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.25.0-dev"
version = "0.25.0"
description = "Build configuration for the PyO3 ecosystem"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"]
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.25.0-dev"
version = "0.25.0"
description = "Python-API bindings for the PyO3 ecosystem"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"]
Expand Down Expand Up @@ -44,7 +44,7 @@ generate-import-lib = ["pyo3-build-config/python3-dll-a"]
paste = "1"

[build-dependencies]
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.0-dev", features = ["resolve-config"] }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.0", features = ["resolve-config"] }

[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,13 +41,13 @@ name = "string_sum"
crate-type = ["cdylib"]

[dependencies.pyo3-ffi]
version = "0.24.2"
version = "0.25.0"
features = ["extension-module"]

[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.24.2"
pyo3_build_config = "0.25.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.25.0-dev"
version = "0.25.0"
description = "Introspect dynamic libraries built with PyO3 to get metadata about the exported Python types"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
homepage = "https://github.com/pyo3/pyo3"
Expand Down
6 changes: 3 additions & 3 deletions 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.25.0-dev"
version = "0.25.0"
description = "Code generation for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"]
Expand All @@ -17,7 +17,7 @@ rust-version = "1.63"
[dependencies]
heck = "0.5"
proc-macro2 = { version = "1.0.60", default-features = false }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.0-dev", features = ["resolve-config"] }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.0", features = ["resolve-config"] }
quote = { version = "1", default-features = false }

[dependencies.syn]
Expand All @@ -26,7 +26,7 @@ default-features = false
features = ["derive", "parsing", "printing", "clone-impls", "full", "extra-traits"]

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

[lints]
workspace = true
Expand Down
4 changes: 2 additions & 2 deletions pyo3-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-macros"
version = "0.25.0-dev"
version = "0.25.0"
description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"]
Expand All @@ -23,7 +23,7 @@ experimental-inspect = ["pyo3-macros-backend/experimental-inspect"]
proc-macro2 = { version = "1.0.60", default-features = false }
quote = "1"
syn = { version = "2", features = ["full", "extra-traits"] }
pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.25.0-dev" }
pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.25.0" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[tool.towncrier]
filename = "CHANGELOG.md"
version = "0.25.0-dev"
version = "0.25.0"
start_string = "<!-- towncrier release notes start -->\n"
template = ".towncrier.template.md"
title_format = "## [{version}] - {project_date}"
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/reject_generics.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.25.0-dev/class.html#no-generic-parameters
error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.25.0/class.html#no-generic-parameters
--> tests/ui/reject_generics.rs:4:25
|
4 | struct ClassWithGenerics<A> {
| ^

error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.25.0-dev/class.html#no-lifetime-parameters
error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.25.0/class.html#no-lifetime-parameters
--> tests/ui/reject_generics.rs:9:27
|
9 | struct ClassWithLifetimes<'a> {
Expand Down
Loading