Skip to content

release: 0.24.0 #4959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2025
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
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,55 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h

<!-- towncrier release notes start -->

## [0.24.0] - 2025-03-09

### Packaging

- Add supported CPython/PyPy versions to cargo package metadata. [#4756](https://github.com/PyO3/pyo3/pull/4756)
- Bump `target-lexicon` dependency to 0.13. [#4822](https://github.com/PyO3/pyo3/pull/4822)
- Add optional `jiff` dependency to add conversions for `jiff` datetime types. [#4823](https://github.com/PyO3/pyo3/pull/4823)
- Bump minimum supported `inventory` version to 0.3.5. [#4954](https://github.com/PyO3/pyo3/pull/4954)

### Added

- Add `PyIterator::send` method to allow sending values into a python generator. [#4746](https://github.com/PyO3/pyo3/pull/4746)
- Add `PyCallArgs` trait for passing arguments into the Python calling protocol. This enabled using a faster calling convention for certain types, improving performance. [#4768](https://github.com/PyO3/pyo3/pull/4768)
- Add `#[pyo3(default = ...']` option for `#[derive(FromPyObject)]` to set a default value for extracted fields of named structs. [#4829](https://github.com/PyO3/pyo3/pull/4829)
- Add `#[pyo3(into_py_with = ...)]` option for `#[derive(IntoPyObject, IntoPyObjectRef)]`. [#4850](https://github.com/PyO3/pyo3/pull/4850)
- Add uuid to/from python conversions. [#4864](https://github.com/PyO3/pyo3/pull/4864)
- Add FFI definitions `PyThreadState_GetFrame` and `PyFrame_GetBack`. [#4866](https://github.com/PyO3/pyo3/pull/4866)
- Optimize `last` for `BoundListIterator`, `BoundTupleIterator` and `BorrowedTupleIterator`. [#4878](https://github.com/PyO3/pyo3/pull/4878)
- Optimize `Iterator::count()` for `PyDict`, `PyList`, `PyTuple` & `PySet`. [#4878](https://github.com/PyO3/pyo3/pull/4878)
- Optimize `nth`, `nth_back`, `advance_by` and `advance_back_by` for `BoundTupleIterator` [#4897](https://github.com/PyO3/pyo3/pull/4897)
- Add support for `types.GenericAlias` as `pyo3::types::PyGenericAlias`. [#4917](https://github.com/PyO3/pyo3/pull/4917)
- Add `MutextExt` trait to help avoid deadlocks with the GIL while locking a `std::sync::Mutex`. [#4934](https://github.com/PyO3/pyo3/pull/4934)
- Add `#[pyo3(rename_all = "...")]` option for `#[derive(FromPyObject)]`. [#4941](https://github.com/PyO3/pyo3/pull/4941)

### Changed

- Optimize `nth`, `nth_back`, `advance_by` and `advance_back_by` for `BoundListIterator`. [#4810](https://github.com/PyO3/pyo3/pull/4810)
- Use `DerefToPyAny` in blanket implementations of `From<Py<T>>` and `From<Bound<'py, T>>` for `PyObject`. [#4593](https://github.com/PyO3/pyo3/pull/4593)
- Map `io::ErrorKind::IsADirectory`/`NotADirectory` to the corresponding Python exception on Rust 1.83+. [#4747](https://github.com/PyO3/pyo3/pull/4747)
- `PyAnyMethods::call` and friends now require `PyCallArgs` for their positional arguments. [#4768](https://github.com/PyO3/pyo3/pull/4768)
- Expose FFI definitions for `PyObject_Vectorcall(Method)` on the stable abi on 3.12+. [#4853](https://github.com/PyO3/pyo3/pull/4853)
- `#[pyo3(from_py_with = ...)]` now take a path rather than a string literal [#4860](https://github.com/PyO3/pyo3/pull/4860)
- Format Python traceback in impl Debug for PyErr. [#4900](https://github.com/PyO3/pyo3/pull/4900)
- Convert `PathBuf` & `Path` into Python `pathlib.Path` instead of `PyString`. [#4925](https://github.com/PyO3/pyo3/pull/4925)
- Relax parsing of exotic Python versions. [#4949](https://github.com/PyO3/pyo3/pull/4949)
- PyO3 threads now hang instead of `pthread_exit` trying to acquire the GIL when the interpreter is shutting down. This mimics the [Python 3.14](https://github.com/python/cpython/issues/87135) behavior and avoids undefined behavior and crashes. [#4874](https://github.com/PyO3/pyo3/pull/4874)

### Removed

- Remove implementations of `Deref` for `PyAny` and other "native" types. [#4593](https://github.com/PyO3/pyo3/pull/4593)
- Remove implicit default of trailing optional arguments (see #2935) [#4729](https://github.com/PyO3/pyo3/pull/4729)
- Remove the deprecated implicit eq fallback for simple enums. [#4730](https://github.com/PyO3/pyo3/pull/4730)

### Fixed

- Correct FFI definition of `PyIter_Send` to return a `PySendResult`. [#4746](https://github.com/PyO3/pyo3/pull/4746)
- Fix a thread safety issue in the runtime borrow checker used by mutable pyclass instances on the free-threaded build. [#4948](https://github.com/PyO3/pyo3/pull/4948)


## [0.23.5] - 2025-02-22
### Packaging

Expand Down Expand Up @@ -2064,7 +2113,8 @@ Yanked

- Initial release

[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.23.5...HEAD
[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.24.0...HEAD
[0.24.0]: https://github.com/pyo3/pyo3/compare/v0.23.5...v0.24.0
[0.23.5]: https://github.com/pyo3/pyo3/compare/v0.23.4...v0.23.5
[0.23.4]: https://github.com/pyo3/pyo3/compare/v0.23.3...v0.23.4
[0.23.3]: https://github.com/pyo3/pyo3/compare/v0.23.2...v0.23.3
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.23.5"
version = "0.24.0"
description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md"
Expand All @@ -21,10 +21,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.23.5" }
pyo3-ffi = { path = "pyo3-ffi", version = "=0.24.0" }

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

Expand Down Expand Up @@ -68,7 +68,7 @@ static_assertions = "1.1.0"
uuid = { version = "1.10.0", features = ["v4"] }

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "=0.23.5", features = ["resolve-config"] }
pyo3-build-config = { path = "pyo3-build-config", version = "=0.24.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.23.5", features = ["extension-module"] }
pyo3 = { version = "0.24.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.23.5"
version = "0.24.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.23.5");
variable::set("PYO3_VERSION", "0.24.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.23.5");
variable::set("PYO3_VERSION", "0.24.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.23.5");
variable::set("PYO3_VERSION", "0.24.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.23.5");
variable::set("PYO3_VERSION", "0.24.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.23.5");
variable::set("PYO3_VERSION", "0.24.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/4593.changed.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4954.packaging.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.23.5"
version = "0.24.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.23.5"
version = "0.24.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 @@ -42,7 +42,7 @@ generate-import-lib = ["pyo3-build-config/python3-dll-a"]
paste = "1"

[build-dependencies]
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.23.5", features = ["resolve-config"] }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.24.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.23.5"
version = "0.24.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.23.5"
pyo3_build_config = "0.24.0"
```

If you need to use conditional compilation based on Python version or how
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.23.5"
version = "0.24.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.23.5", features = ["resolve-config"] }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.24.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.23.5" }
pyo3-build-config = { path = "../pyo3-build-config", version = "=0.24.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.23.5"
version = "0.24.0"
description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"]
Expand All @@ -22,7 +22,7 @@ experimental-async = ["pyo3-macros-backend/experimental-async"]
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.23.5" }
pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.24.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.23.5"
version = "0.24.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.23.5/class.html#no-generic-parameters
error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.24.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.23.5/class.html#no-lifetime-parameters
error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.24.0/class.html#no-lifetime-parameters
--> tests/ui/reject_generics.rs:9:27
|
9 | struct ClassWithLifetimes<'a> {
Expand Down
Loading