From 7091beafa6932aadd3310499ff15051f0982f130 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Tue, 26 Aug 2025 08:46:41 +0100 Subject: [PATCH] release: 0.26.0 --- CHANGELOG.md | 81 ++++++++++++++++++- Cargo.toml | 8 +- README.md | 4 +- examples/decorator/.template/pre-script.rhai | 2 +- .../maturin-starter/.template/pre-script.rhai | 2 +- examples/plugin/.template/pre-script.rhai | 2 +- .../.template/pre-script.rhai | 2 +- examples/word-count/.template/pre-script.rhai | 2 +- newsfragments/4364.added.md | 1 - newsfragments/4523.added.md | 2 - newsfragments/4568.changed.md | 1 - newsfragments/4742.fixed.md | 1 - newsfragments/4777.changed.md | 1 - newsfragments/5017.added.md | 1 - newsfragments/5017.changed.md | 1 - newsfragments/5089.added.md | 1 - newsfragments/5144.changed.md | 1 - newsfragments/5146.changed.md | 1 - newsfragments/5152.packaging.md | 1 - newsfragments/5154.added.md | 3 - newsfragments/5154.removed.md | 1 - newsfragments/5159.fixed.md | 1 - newsfragments/5171.packaging.md | 1 - newsfragments/5192.packaging.md | 1 - newsfragments/5196.removed.md | 1 - newsfragments/5198.fixed.md | 1 - newsfragments/5201.changed.md | 1 - newsfragments/5206.changed.md | 1 - newsfragments/5207.added.md | 1 - newsfragments/5208.added.md | 1 - newsfragments/5209.changed.md | 1 - newsfragments/5210.changed.md | 1 - newsfragments/5217.added.md | 1 - newsfragments/5221.changed.md | 1 - newsfragments/5223.added.md | 1 - newsfragments/5223.changed.md | 1 - newsfragments/5233.added.md | 1 - newsfragments/5239.fixed.md | 1 - newsfragments/5241.added.md | 1 - newsfragments/5242.fixed.md | 1 - newsfragments/5247.changed.md | 1 - newsfragments/5251.fixed.md | 1 - newsfragments/5252.added.md | 1 - newsfragments/5255.added.md | 1 - newsfragments/5256.added.md | 1 - newsfragments/5258.added.md | 1 - newsfragments/5272.added.md | 2 - newsfragments/5273.fixed.md | 1 - newsfragments/5281.fixed.md | 1 - newsfragments/5285.changed.md | 1 - newsfragments/5286.changed.md | 1 - newsfragments/5289.added.md | 1 - newsfragments/5300.added.md | 1 - newsfragments/5317.added.md | 1 - newsfragments/5317.changed.md | 1 - newsfragments/5317.fixed.md | 1 - newsfragments/5317.removed.md | 1 - newsfragments/5318.fixed.md | 1 - newsfragments/5320.added.md | 1 - newsfragments/5324.changed.md | 1 - newsfragments/5325.changed.md | 1 - newsfragments/5337.changed.md | 1 - newsfragments/5338.added.md | 1 - newsfragments/5339.added.md | 1 - newsfragments/5340.changed.md | 1 - newsfragments/5342.added.md | 1 - newsfragments/5343.added.md | 1 - newsfragments/5351.added.md | 1 - newsfragments/5354.changed.md | 1 - pyo3-build-config/Cargo.toml | 2 +- pyo3-ffi/Cargo.toml | 4 +- pyo3-ffi/README.md | 4 +- pyo3-introspection/Cargo.toml | 2 +- pyo3-macros-backend/Cargo.toml | 6 +- pyo3-macros/Cargo.toml | 4 +- pyproject.toml | 2 +- tests/ui/reject_generics.stderr | 4 +- 77 files changed, 104 insertions(+), 92 deletions(-) delete mode 100644 newsfragments/4364.added.md delete mode 100644 newsfragments/4523.added.md delete mode 100644 newsfragments/4568.changed.md delete mode 100644 newsfragments/4742.fixed.md delete mode 100644 newsfragments/4777.changed.md delete mode 100644 newsfragments/5017.added.md delete mode 100644 newsfragments/5017.changed.md delete mode 100644 newsfragments/5089.added.md delete mode 100644 newsfragments/5144.changed.md delete mode 100644 newsfragments/5146.changed.md delete mode 100644 newsfragments/5152.packaging.md delete mode 100644 newsfragments/5154.added.md delete mode 100644 newsfragments/5154.removed.md delete mode 100644 newsfragments/5159.fixed.md delete mode 100644 newsfragments/5171.packaging.md delete mode 100644 newsfragments/5192.packaging.md delete mode 100644 newsfragments/5196.removed.md delete mode 100644 newsfragments/5198.fixed.md delete mode 100644 newsfragments/5201.changed.md delete mode 100644 newsfragments/5206.changed.md delete mode 100644 newsfragments/5207.added.md delete mode 100644 newsfragments/5208.added.md delete mode 100644 newsfragments/5209.changed.md delete mode 100644 newsfragments/5210.changed.md delete mode 100644 newsfragments/5217.added.md delete mode 100644 newsfragments/5221.changed.md delete mode 100644 newsfragments/5223.added.md delete mode 100644 newsfragments/5223.changed.md delete mode 100644 newsfragments/5233.added.md delete mode 100644 newsfragments/5239.fixed.md delete mode 100644 newsfragments/5241.added.md delete mode 100644 newsfragments/5242.fixed.md delete mode 100644 newsfragments/5247.changed.md delete mode 100644 newsfragments/5251.fixed.md delete mode 100644 newsfragments/5252.added.md delete mode 100644 newsfragments/5255.added.md delete mode 100644 newsfragments/5256.added.md delete mode 100644 newsfragments/5258.added.md delete mode 100644 newsfragments/5272.added.md delete mode 100644 newsfragments/5273.fixed.md delete mode 100644 newsfragments/5281.fixed.md delete mode 100644 newsfragments/5285.changed.md delete mode 100644 newsfragments/5286.changed.md delete mode 100644 newsfragments/5289.added.md delete mode 100644 newsfragments/5300.added.md delete mode 100644 newsfragments/5317.added.md delete mode 100644 newsfragments/5317.changed.md delete mode 100644 newsfragments/5317.fixed.md delete mode 100644 newsfragments/5317.removed.md delete mode 100644 newsfragments/5318.fixed.md delete mode 100644 newsfragments/5320.added.md delete mode 100644 newsfragments/5324.changed.md delete mode 100644 newsfragments/5325.changed.md delete mode 100644 newsfragments/5337.changed.md delete mode 100644 newsfragments/5338.added.md delete mode 100644 newsfragments/5339.added.md delete mode 100644 newsfragments/5340.changed.md delete mode 100644 newsfragments/5342.added.md delete mode 100644 newsfragments/5343.added.md delete mode 100644 newsfragments/5351.added.md delete mode 100644 newsfragments/5354.changed.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d7bc1ac680..d42b92916fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,82 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h +## [0.26.0] - 2025-08-29 + +### Packaging + +- Bump hashbrown dependency to 0.15. [#5152](https://github.com/PyO3/pyo3/pull/5152) +- Update MSRV to 1.74. [#5171](https://github.com/PyO3/pyo3/pull/5171) +- Set the same maximum supported version for alternative interpreters as for CPython. [#5192](https://github.com/PyO3/pyo3/pull/5192) +- Add optional `bytes` dependency to add conversions for `bytes::Bytes`. [#5252](https://github.com/PyO3/pyo3/pull/5252) +- Publish new crate `pyo3-introspection` to pair with the `experimental-inspect` feature. [#5300](https://github.com/PyO3/pyo3/pull/5300) +- The `PYO3_BUILD_EXTENSION_MODULE` now causes the same effect as the `extension-module` feature. Eventually we expect maturin and setuptools-rust to set this environment variable automatically. Users with their own build systems will need to do the same. [#5343](https://github.com/PyO3/pyo3/pull/5343) + +### Added + +- Add `#[pyo3(warn(message = "...", category = ...))]` attribute for automatic warnings generation for `#[pyfunction]` and `#[pymethods]`. [#4364](https://github.com/PyO3/pyo3/pull/4364) +- Add `PyMutex`, available on Python 3.13 and newer. [#4523](https://github.com/PyO3/pyo3/pull/4523) +- Add FFI definition `PyMutex_IsLocked`, available on Python 3.14 and newer. [#4523](https://github.com/PyO3/pyo3/pull/4523) +- Add `PyString::from_encoded_object`. [#5017](https://github.com/PyO3/pyo3/pull/5017) +- `experimental-inspect`: add basic input type annotations. [#5089](https://github.com/PyO3/pyo3/pull/5089) +- Add FFI function definitions for `PyFrameObject` from CPython 3.13. [#5154](https://github.com/PyO3/pyo3/pull/5154) +- `experimental-inspect`: tag modules created using `#[pymodule]` or `#[pymodule_init]` functions as incomplete. [#5207](https://github.com/PyO3/pyo3/pull/5207) +- `experimental-inspect`: add basic return type support. [#5208](https://github.com/PyO3/pyo3/pull/5208) +- Add `PyCode::compile` and `PyCodeMethods::run` to create and execute code objects. [#5217](https://github.com/PyO3/pyo3/pull/5217) +- Add `PyOnceLock` type for thread-safe single-initialization. [#5223](https://github.com/PyO3/pyo3/pull/5223) +- Add `PyClassGuard(Mut)` pyclass holders. In the future they will replace `PyRef(Mut)`. [#5233](https://github.com/PyO3/pyo3/pull/5233) +- `experimental-inspect`: allow annotations in `#[pyo3(signature)]` signature attribute. [#5241](https://github.com/PyO3/pyo3/pull/5241) +- Implement `MutexExt` for parking_lot's/lock_api `ReentrantMutex`. [#5258](https://github.com/PyO3/pyo3/pull/5258) +- `experimental-inspect`: support class associated constants. [#5272](https://github.com/PyO3/pyo3/pull/5272) +- Add `Bound::cast` family of functions superseding the `PyAnyMethods::downcast` family. [#5289](https://github.com/PyO3/pyo3/pull/5289) +- Add FFI definitions `Py_Version` and `Py_IsFinalizing`. [#5317](https://github.com/PyO3/pyo3/pull/5317) +- `experimental-inspect`: add output type annotation for `#[pyclass]`. [#5320](https://github.com/PyO3/pyo3/pull/5320) +- `experimental-inspect`: support `#[pyclass(eq, eq_int, ord, hash, str)]`. [#5338](https://github.com/PyO3/pyo3/pull/5338) +- `experimental-inspect`: add basic support for `#[derive(FromPyObject)]` (no struct fields support yet). [#5339](https://github.com/PyO3/pyo3/pull/5339) +- Add `Python::try_attach`. [#5342](https://github.com/PyO3/pyo3/pull/5342) + +### Changed + +- Use `Py_TPFLAGS_DISALLOW_INSTANTIATION` instead of a `__new__` which always fails for a `#[pyclass]` without a `#[new]` on Python 3.10 and up. [#4568](https://github.com/PyO3/pyo3/pull/4568) +- `PyModule::from_code` now defaults `file_name` to `` if empty. [#4777](https://github.com/PyO3/pyo3/pull/4777) +- Deprecate `PyString::from_object` in favour of `PyString::from_encoded_object`. [#5017](https://github.com/PyO3/pyo3/pull/5017) +- When building with `abi3` for a Python version newer than pyo3 supports, automatically fall back to an abi3 build for the latest supported version. [#5144](https://github.com/PyO3/pyo3/pull/5144) +- Change `is_instance_of` trait bound from `PyTypeInfo` to `PyTypeCheck`. [#5146](https://github.com/PyO3/pyo3/pull/5146) +- Many PyO3 proc macros now report multiple errors instead of only the first one. [#5159](https://github.com/PyO3/pyo3/pull/5159) +- Change `MutexExt` return type to be an associated type. [#5201](https://github.com/PyO3/pyo3/pull/5201) +- Use `PyCallArgs` for `Py::call` and friends so they're equivalent to their `Bound` counterpart. [#5206](https://github.com/PyO3/pyo3/pull/5206) +- Rename `Python::with_gil` to `Python::attach`. [#5209](https://github.com/PyO3/pyo3/pull/5209) +- Rename `Python::allow_threads` to `Python::detach` [#5221](https://github.com/PyO3/pyo3/pull/5221) +- Deprecate `GILOnceCell` type in favour of `PyOnceLock`. [#5223](https://github.com/PyO3/pyo3/pull/5223) +- Rename `pyo3::prepare_freethreaded_python` to `Python::initialize`. [#5247](https://github.com/PyO3/pyo3/pull/5247) +- Convert `PyMemoryError` into/from `io::ErrorKind::OutOfMemory`. [#5256](https://github.com/PyO3/pyo3/pull/5256) +- Deprecate `GILProtected`. [#5285](https://github.com/PyO3/pyo3/pull/5285) +- Move `#[pyclass]` docstring formatting from import time to compile time. [#5286](https://github.com/PyO3/pyo3/pull/5286) +- `Python::attach` will now panic if the Python interpreter is in the process of shutting down. [#5317](https://github.com/PyO3/pyo3/pull/5317) +- Add fast-path to `PyTypeInfo::type_object` for `#[pyclass]` types. [#5324](https://github.com/PyO3/pyo3/pull/5324) +- Deprecate `PyObject` type alias for `Py`. [#5325](https://github.com/PyO3/pyo3/pull/5325) +- Rename `Python::with_gil_unchecked` to `Python::attach_unchecked`. [#5340](https://github.com/PyO3/pyo3/pull/5340) +- Rename `Python::assume_gil_acquired` to `Python::assume_attached`. [#5354](https://github.com/PyO3/pyo3/pull/5354) + +### Removed + +- Remove FFI definition of internals of `PyFrameObject`. [#5154](https://github.com/PyO3/pyo3/pull/5154) +- Remove `Eq` and `PartialEq` implementations on `PyGetSetDef` FFI definition. [#5196](https://github.com/PyO3/pyo3/pull/5196) +- Remove private FFI definitions `_Py_IsCoreInitialized` and `_Py_InitializeMain`. [#5317](https://github.com/PyO3/pyo3/pull/5317) + +### Fixed + +- Use critical section in `PyByteArray::to_vec` on freethreaded build to replicate GIL-enabled "soundness". [#4742](https://github.com/PyO3/pyo3/pull/4742) +- Fix precision loss when converting `bigdecimal` into Python. [#5198](https://github.com/PyO3/pyo3/pull/5198) +- Don't treat win7 target as a cross-compilation. [#5210](https://github.com/PyO3/pyo3/pull/5210) +- WASM targets no longer require exception handling support for Python < 3.14. [#5239](https://github.com/PyO3/pyo3/pull/5239) +- Fix segfault when dropping `PyBuffer` after the Python interpreter has been finalized. [#5242](https://github.com/PyO3/pyo3/pull/5242) +- `experimental-inspect`: better automated imports generation. [#5251](https://github.com/PyO3/pyo3/pull/5251) +- `experimental-inspect`: fix introspection of `__richcmp__`, `__concat__`, `__repeat__`, `__inplace_concat__` and `__inplace_repeat__`. [#5273](https://github.com/PyO3/pyo3/pull/5273) +- fixed a leaked borrow, when converting a mutable sub class into a frozen base class using `PyRef::into_super` [#5281](https://github.com/PyO3/pyo3/pull/5281) +- Fix FFI definition `Py_Exit` (never returns, was `()` return value, now `!`). [#5317](https://github.com/PyO3/pyo3/pull/5317) +- `experimental-inspect`: fix handling of module members gated behind `#[cfg(...)]` attributes. [#5318](https://github.com/PyO3/pyo3/pull/5318) + ## [0.25.1] - 2025-06-12 ### Packaging @@ -2220,8 +2296,9 @@ Yanked - Initial release -[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.25.1...HEAD -[0.25.0]: https://github.com/pyo3/pyo3/compare/v0.25.0...v0.25.1 +[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.26.0...HEAD +[0.26.0]: https://github.com/pyo3/pyo3/compare/v0.25.1...v0.26.0 +[0.25.1]: https://github.com/pyo3/pyo3/compare/v0.25.0...v0.25.1 [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 diff --git a/Cargo.toml b/Cargo.toml index ca912d91444..030174f62e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3" -version = "0.26.0-dev" +version = "0.26.0" description = "Bindings to Python interpreter" authors = ["PyO3 Project and Contributors "] readme = "README.md" @@ -30,10 +30,10 @@ memoffset = "0.9" 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.25.1" } +pyo3-ffi = { path = "pyo3-ffi", version = "=0.26.0" } # support crates for macros feature -pyo3-macros = { path = "pyo3-macros", version = "=0.25.1", optional = true } +pyo3-macros = { path = "pyo3-macros", version = "=0.26.0", optional = true } indoc = { version = "2.0.1", optional = true } unindent = { version = "0.2.1", optional = true } @@ -85,7 +85,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.1", features = ["resolve-config"] } +pyo3-build-config = { path = "pyo3-build-config", version = "=0.26.0", features = ["resolve-config"] } [features] default = ["macros"] diff --git a/README.md b/README.md index 72af4eee9ff..7508d851dbc 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.25.1", features = ["extension-module"] } +pyo3 = { version = "0.26.0", features = ["extension-module"] } ``` **`src/lib.rs`** @@ -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.25.1" +version = "0.26.0" features = ["auto-initialize"] ``` diff --git a/examples/decorator/.template/pre-script.rhai b/examples/decorator/.template/pre-script.rhai index 110a6e82130..3abc923be1f 100644 --- a/examples/decorator/.template/pre-script.rhai +++ b/examples/decorator/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.25.1"); +variable::set("PYO3_VERSION", "0.26.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::rename(".template/pyproject.toml", "pyproject.toml"); file::delete(".template"); diff --git a/examples/maturin-starter/.template/pre-script.rhai b/examples/maturin-starter/.template/pre-script.rhai index 110a6e82130..3abc923be1f 100644 --- a/examples/maturin-starter/.template/pre-script.rhai +++ b/examples/maturin-starter/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.25.1"); +variable::set("PYO3_VERSION", "0.26.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::rename(".template/pyproject.toml", "pyproject.toml"); file::delete(".template"); diff --git a/examples/plugin/.template/pre-script.rhai b/examples/plugin/.template/pre-script.rhai index d21dae34ad8..27204393c47 100644 --- a/examples/plugin/.template/pre-script.rhai +++ b/examples/plugin/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.25.1"); +variable::set("PYO3_VERSION", "0.26.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::rename(".template/plugin_api/Cargo.toml", "plugin_api/Cargo.toml"); file::delete(".template"); diff --git a/examples/setuptools-rust-starter/.template/pre-script.rhai b/examples/setuptools-rust-starter/.template/pre-script.rhai index b27db6f2700..9f25f008fe6 100644 --- a/examples/setuptools-rust-starter/.template/pre-script.rhai +++ b/examples/setuptools-rust-starter/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.25.1"); +variable::set("PYO3_VERSION", "0.26.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::rename(".template/setup.cfg", "setup.cfg"); file::delete(".template"); diff --git a/examples/word-count/.template/pre-script.rhai b/examples/word-count/.template/pre-script.rhai index 110a6e82130..3abc923be1f 100644 --- a/examples/word-count/.template/pre-script.rhai +++ b/examples/word-count/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.25.1"); +variable::set("PYO3_VERSION", "0.26.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::rename(".template/pyproject.toml", "pyproject.toml"); file::delete(".template"); diff --git a/newsfragments/4364.added.md b/newsfragments/4364.added.md deleted file mode 100644 index 503cb7ae2c5..00000000000 --- a/newsfragments/4364.added.md +++ /dev/null @@ -1 +0,0 @@ -Added `#[pyo3(warn(message = "...", category = ...))]` attribute for automatic warnings generation for `#[pyfunction]` and `#[pymethods]`. \ No newline at end of file diff --git a/newsfragments/4523.added.md b/newsfragments/4523.added.md deleted file mode 100644 index a699bfc4956..00000000000 --- a/newsfragments/4523.added.md +++ /dev/null @@ -1,2 +0,0 @@ -* Added a Rust wrapper for `PyMutex`, available on Python 3.13 and newer. -* Added bindings for PyMutex_IsLocked, available on Python 3.14 and newer. \ No newline at end of file diff --git a/newsfragments/4568.changed.md b/newsfragments/4568.changed.md deleted file mode 100644 index bbc68355952..00000000000 --- a/newsfragments/4568.changed.md +++ /dev/null @@ -1 +0,0 @@ -Use `Py_TPFLAGS_DISALLOW_INSTANTIATION` instead of a `__new__` which always fails for a `#[pyclass]` without a `#[new]` on Python 3.10 and up. diff --git a/newsfragments/4742.fixed.md b/newsfragments/4742.fixed.md deleted file mode 100644 index 7bfe38b0c38..00000000000 --- a/newsfragments/4742.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Use critical section in `PyByteArray::to_vec` on freethreaded build to replicate GIL-enabled "soundness". diff --git a/newsfragments/4777.changed.md b/newsfragments/4777.changed.md deleted file mode 100644 index b4e2163a3b8..00000000000 --- a/newsfragments/4777.changed.md +++ /dev/null @@ -1 +0,0 @@ -`PyModule::from_code` now defaults `file_name` to `` if empty. Ref #4769 \ No newline at end of file diff --git a/newsfragments/5017.added.md b/newsfragments/5017.added.md deleted file mode 100644 index bf27988735e..00000000000 --- a/newsfragments/5017.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `PyString::from_encoded_object`. diff --git a/newsfragments/5017.changed.md b/newsfragments/5017.changed.md deleted file mode 100644 index 9d5f477cff7..00000000000 --- a/newsfragments/5017.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate `PyString::from_object` in favour of `PyString::from_encoded_object`. diff --git a/newsfragments/5089.added.md b/newsfragments/5089.added.md deleted file mode 100644 index 1ce0d3cb893..00000000000 --- a/newsfragments/5089.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: Adds very basic input type annotations (not all types are covered yet) \ No newline at end of file diff --git a/newsfragments/5144.changed.md b/newsfragments/5144.changed.md deleted file mode 100644 index 3812e70197a..00000000000 --- a/newsfragments/5144.changed.md +++ /dev/null @@ -1 +0,0 @@ -When building with `abi3` for a Python version newer than pyo3 supports, we now automatically fall back to an abi3 build for the latest version. diff --git a/newsfragments/5146.changed.md b/newsfragments/5146.changed.md deleted file mode 100644 index 72958216001..00000000000 --- a/newsfragments/5146.changed.md +++ /dev/null @@ -1 +0,0 @@ -Allow `is_instance_of` for types that only implement `PyTypeCheck` diff --git a/newsfragments/5152.packaging.md b/newsfragments/5152.packaging.md deleted file mode 100644 index 464c3081a33..00000000000 --- a/newsfragments/5152.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Bump hashbrown to 0.15.0 \ No newline at end of file diff --git a/newsfragments/5154.added.md b/newsfragments/5154.added.md deleted file mode 100644 index 97147e17117..00000000000 --- a/newsfragments/5154.added.md +++ /dev/null @@ -1,3 +0,0 @@ -* added missing ffi functions for `PyFrameObject` but without - including unstable API from python 3.13 -* moved ffi functions to correct files to mach CPython as of 3.13 \ No newline at end of file diff --git a/newsfragments/5154.removed.md b/newsfragments/5154.removed.md deleted file mode 100644 index a625a742c0c..00000000000 --- a/newsfragments/5154.removed.md +++ /dev/null @@ -1 +0,0 @@ -* Removed access to internals of PyFrameObject \ No newline at end of file diff --git a/newsfragments/5159.fixed.md b/newsfragments/5159.fixed.md deleted file mode 100644 index 089de2c17d6..00000000000 --- a/newsfragments/5159.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Changed macro implementations to show multiple errors to users instead of only the first one. \ No newline at end of file diff --git a/newsfragments/5171.packaging.md b/newsfragments/5171.packaging.md deleted file mode 100644 index 7d54315d9a7..00000000000 --- a/newsfragments/5171.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Update MSRV to 1.74. diff --git a/newsfragments/5192.packaging.md b/newsfragments/5192.packaging.md deleted file mode 100644 index 12fb9a3808c..00000000000 --- a/newsfragments/5192.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Set the same maximum supported version for alternative interpreters as for CPython diff --git a/newsfragments/5196.removed.md b/newsfragments/5196.removed.md deleted file mode 100644 index 6784fb05709..00000000000 --- a/newsfragments/5196.removed.md +++ /dev/null @@ -1 +0,0 @@ -Remove `Eq` and `PartialEq` implementations on `PyGetSetDef` \ No newline at end of file diff --git a/newsfragments/5198.fixed.md b/newsfragments/5198.fixed.md deleted file mode 100644 index fb07972894b..00000000000 --- a/newsfragments/5198.fixed.md +++ /dev/null @@ -1 +0,0 @@ -fix precision loss when converting `bigdecimal` into python diff --git a/newsfragments/5201.changed.md b/newsfragments/5201.changed.md deleted file mode 100644 index a61a8ca992b..00000000000 --- a/newsfragments/5201.changed.md +++ /dev/null @@ -1 +0,0 @@ -Move `MutexExt` return type into associated type diff --git a/newsfragments/5206.changed.md b/newsfragments/5206.changed.md deleted file mode 100644 index dba13327867..00000000000 --- a/newsfragments/5206.changed.md +++ /dev/null @@ -1 +0,0 @@ -use `PyCallArgs` for `Py::call` and friends so they're equivalent to their `Bound` counterpart \ No newline at end of file diff --git a/newsfragments/5207.added.md b/newsfragments/5207.added.md deleted file mode 100644 index 23691f14bb5..00000000000 --- a/newsfragments/5207.added.md +++ /dev/null @@ -1 +0,0 @@ -Type stubs: tag modules created using `#[pymodule]` or `#[pymodule_init]` functions as incomplete \ No newline at end of file diff --git a/newsfragments/5208.added.md b/newsfragments/5208.added.md deleted file mode 100644 index 13f44a20a19..00000000000 --- a/newsfragments/5208.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection and sub generation: add basic return type support \ No newline at end of file diff --git a/newsfragments/5209.changed.md b/newsfragments/5209.changed.md deleted file mode 100644 index 17e097b2bc7..00000000000 --- a/newsfragments/5209.changed.md +++ /dev/null @@ -1 +0,0 @@ -rename `Python::with_gil` to `Python::attach` \ No newline at end of file diff --git a/newsfragments/5210.changed.md b/newsfragments/5210.changed.md deleted file mode 100644 index 166065fb197..00000000000 --- a/newsfragments/5210.changed.md +++ /dev/null @@ -1 +0,0 @@ -Don't necessarily treat win7 target as a cross-compilation diff --git a/newsfragments/5217.added.md b/newsfragments/5217.added.md deleted file mode 100644 index 2762b422a1b..00000000000 --- a/newsfragments/5217.added.md +++ /dev/null @@ -1 +0,0 @@ -add `PyCode::compile` and `PyCodeMethods::run` to create and execute code objects \ No newline at end of file diff --git a/newsfragments/5221.changed.md b/newsfragments/5221.changed.md deleted file mode 100644 index afc86a3dd12..00000000000 --- a/newsfragments/5221.changed.md +++ /dev/null @@ -1 +0,0 @@ -rename `Python::allow_threads` to `Python::detach` \ No newline at end of file diff --git a/newsfragments/5223.added.md b/newsfragments/5223.added.md deleted file mode 100644 index c8847b310d7..00000000000 --- a/newsfragments/5223.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `PyOnceLock` type for thread-safe single-initialization. diff --git a/newsfragments/5223.changed.md b/newsfragments/5223.changed.md deleted file mode 100644 index 1c1ff1b2bf1..00000000000 --- a/newsfragments/5223.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate `GILOnceCell` type in favour of `PyOnceLock`. diff --git a/newsfragments/5233.added.md b/newsfragments/5233.added.md deleted file mode 100644 index 38ac4051890..00000000000 --- a/newsfragments/5233.added.md +++ /dev/null @@ -1 +0,0 @@ -added new `PyClassGuard(Mut)` pyclass holders. In the future they will replace `PyRef(Mut)` \ No newline at end of file diff --git a/newsfragments/5239.fixed.md b/newsfragments/5239.fixed.md deleted file mode 100644 index 5361be01b9f..00000000000 --- a/newsfragments/5239.fixed.md +++ /dev/null @@ -1 +0,0 @@ -WASM targets no longer require exception handling support for Python < 3.14. diff --git a/newsfragments/5241.added.md b/newsfragments/5241.added.md deleted file mode 100644 index ed70f89c963..00000000000 --- a/newsfragments/5241.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: Allow to set annotations in PyO3 signature attribute \ No newline at end of file diff --git a/newsfragments/5242.fixed.md b/newsfragments/5242.fixed.md deleted file mode 100644 index 04210360e0c..00000000000 --- a/newsfragments/5242.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix segfault when dropping `PyBuffer` after the Python interpreter has been finalized. diff --git a/newsfragments/5247.changed.md b/newsfragments/5247.changed.md deleted file mode 100644 index 0ab8eae0662..00000000000 --- a/newsfragments/5247.changed.md +++ /dev/null @@ -1 +0,0 @@ -rename `pyo3::prepare_freethreaded_python` to `Python::initialize` \ No newline at end of file diff --git a/newsfragments/5251.fixed.md b/newsfragments/5251.fixed.md deleted file mode 100644 index ba58d25440d..00000000000 --- a/newsfragments/5251.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: better automated imports generation \ No newline at end of file diff --git a/newsfragments/5252.added.md b/newsfragments/5252.added.md deleted file mode 100644 index 3d9362e6c05..00000000000 --- a/newsfragments/5252.added.md +++ /dev/null @@ -1 +0,0 @@ -Add bytes to/from python conversions. diff --git a/newsfragments/5255.added.md b/newsfragments/5255.added.md deleted file mode 100644 index d4dec2f63cf..00000000000 --- a/newsfragments/5255.added.md +++ /dev/null @@ -1 +0,0 @@ -Guide page on type stubs and introspection \ No newline at end of file diff --git a/newsfragments/5256.added.md b/newsfragments/5256.added.md deleted file mode 100644 index 189701405d1..00000000000 --- a/newsfragments/5256.added.md +++ /dev/null @@ -1 +0,0 @@ -Allow converting `PyMemoryError` into/from `io::ErrorKind::OutOfMemory` diff --git a/newsfragments/5258.added.md b/newsfragments/5258.added.md deleted file mode 100644 index 773a74ef134..00000000000 --- a/newsfragments/5258.added.md +++ /dev/null @@ -1 +0,0 @@ -Impl `MutexExt` for parking_lot's/lock_api `ReentrantMutex` diff --git a/newsfragments/5272.added.md b/newsfragments/5272.added.md deleted file mode 100644 index 5b43bad7dc1..00000000000 --- a/newsfragments/5272.added.md +++ /dev/null @@ -1,2 +0,0 @@ -Introspection: support of class associated constants -Introspection: consolidate constants representation into a more generic attribute concept \ No newline at end of file diff --git a/newsfragments/5273.fixed.md b/newsfragments/5273.fixed.md deleted file mode 100644 index bbe7f10ed06..00000000000 --- a/newsfragments/5273.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: Fixes introspection of `__richcmp__`, `__concat__`, `__repeat__`, `__inplace_concat__` and `__inplace_repeat__` \ No newline at end of file diff --git a/newsfragments/5281.fixed.md b/newsfragments/5281.fixed.md deleted file mode 100644 index aa6ae24cfd2..00000000000 --- a/newsfragments/5281.fixed.md +++ /dev/null @@ -1 +0,0 @@ -fixed a leaked borrow, when converting a mutable sub class into a frozen base class using `PyRef::into_super` \ No newline at end of file diff --git a/newsfragments/5285.changed.md b/newsfragments/5285.changed.md deleted file mode 100644 index 9d1523a72a7..00000000000 --- a/newsfragments/5285.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate `GILProtected`. diff --git a/newsfragments/5286.changed.md b/newsfragments/5286.changed.md deleted file mode 100644 index 1bb754dd0c1..00000000000 --- a/newsfragments/5286.changed.md +++ /dev/null @@ -1 +0,0 @@ -Move `#[pyclass]` docstring formatting from import time to compile time. diff --git a/newsfragments/5289.added.md b/newsfragments/5289.added.md deleted file mode 100644 index 5cdee26e1c9..00000000000 --- a/newsfragments/5289.added.md +++ /dev/null @@ -1 +0,0 @@ -added `Bound::cast` family of functions superseding the `PyAnyMethods::downcast` family \ No newline at end of file diff --git a/newsfragments/5300.added.md b/newsfragments/5300.added.md deleted file mode 100644 index ebcff684f17..00000000000 --- a/newsfragments/5300.added.md +++ /dev/null @@ -1 +0,0 @@ -Publish `pyo3-introspection` to crates.io \ No newline at end of file diff --git a/newsfragments/5317.added.md b/newsfragments/5317.added.md deleted file mode 100644 index b6a571de59c..00000000000 --- a/newsfragments/5317.added.md +++ /dev/null @@ -1 +0,0 @@ -Add FFI definitions `Py_Version` and `Py_IsFinalizing`. diff --git a/newsfragments/5317.changed.md b/newsfragments/5317.changed.md deleted file mode 100644 index 7d80ec4cfdd..00000000000 --- a/newsfragments/5317.changed.md +++ /dev/null @@ -1 +0,0 @@ -`Python::attach` will now panic if the Python interpreter is in the process of shutting down. diff --git a/newsfragments/5317.fixed.md b/newsfragments/5317.fixed.md deleted file mode 100644 index 0d0a752e338..00000000000 --- a/newsfragments/5317.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix FFI definition `Py_Exit` (never returns, was `()` return value, now `!`). diff --git a/newsfragments/5317.removed.md b/newsfragments/5317.removed.md deleted file mode 100644 index 5269ccda918..00000000000 --- a/newsfragments/5317.removed.md +++ /dev/null @@ -1 +0,0 @@ -Remove private FFI definitions `_Py_IsCoreInitialized` and `_Py_InitializeMain` diff --git a/newsfragments/5318.fixed.md b/newsfragments/5318.fixed.md deleted file mode 100644 index 7d2a8770f3c..00000000000 --- a/newsfragments/5318.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: properly include module members gated behind `#[cfg(...)]` attributes \ No newline at end of file diff --git a/newsfragments/5320.added.md b/newsfragments/5320.added.md deleted file mode 100644 index bbea32386e3..00000000000 --- a/newsfragments/5320.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: Properly generate output type annotation for #[pyclass] \ No newline at end of file diff --git a/newsfragments/5324.changed.md b/newsfragments/5324.changed.md deleted file mode 100644 index 11aed953100..00000000000 --- a/newsfragments/5324.changed.md +++ /dev/null @@ -1 +0,0 @@ -Add fast-path to `PyTypeInfo::type_object` for `#[pyclass]` types. diff --git a/newsfragments/5325.changed.md b/newsfragments/5325.changed.md deleted file mode 100644 index aba0a81cc50..00000000000 --- a/newsfragments/5325.changed.md +++ /dev/null @@ -1 +0,0 @@ -deprecated `PyObject` type alias for `Py` \ No newline at end of file diff --git a/newsfragments/5337.changed.md b/newsfragments/5337.changed.md deleted file mode 100644 index d773e1602f4..00000000000 --- a/newsfragments/5337.changed.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: add compatibility with Goblin 0.10 \ No newline at end of file diff --git a/newsfragments/5338.added.md b/newsfragments/5338.added.md deleted file mode 100644 index be50ef2489f..00000000000 --- a/newsfragments/5338.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: support #[pyclass(eq, eq_int, ord, hash, str)] \ No newline at end of file diff --git a/newsfragments/5339.added.md b/newsfragments/5339.added.md deleted file mode 100644 index a12a1da6e3a..00000000000 --- a/newsfragments/5339.added.md +++ /dev/null @@ -1 +0,0 @@ -Basic introspection of `#[derive(FromPyObject)]` (no struct fields support yet) \ No newline at end of file diff --git a/newsfragments/5340.changed.md b/newsfragments/5340.changed.md deleted file mode 100644 index ba669356a06..00000000000 --- a/newsfragments/5340.changed.md +++ /dev/null @@ -1 +0,0 @@ -rename `Python::with_gil_unchecked` to `Python::attach_unchecked` \ No newline at end of file diff --git a/newsfragments/5342.added.md b/newsfragments/5342.added.md deleted file mode 100644 index 8972d8d6fda..00000000000 --- a/newsfragments/5342.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `Python::try_attach`. diff --git a/newsfragments/5343.added.md b/newsfragments/5343.added.md deleted file mode 100644 index 358d3c8fbad..00000000000 --- a/newsfragments/5343.added.md +++ /dev/null @@ -1 +0,0 @@ -When building pyo3, setting the `PYO3_BUILD_EXTENSION_MODULE` causes the same effect as the `extension-module` feature. Eventually we expect maturin and setuptools-rust to set this environment variable automatically. Users with their own build systems will need to do the same. diff --git a/newsfragments/5351.added.md b/newsfragments/5351.added.md deleted file mode 100644 index 9cefb8c1d19..00000000000 --- a/newsfragments/5351.added.md +++ /dev/null @@ -1 +0,0 @@ -Introspection: copy annotations in some generic impls \ No newline at end of file diff --git a/newsfragments/5354.changed.md b/newsfragments/5354.changed.md deleted file mode 100644 index 165f65c0567..00000000000 --- a/newsfragments/5354.changed.md +++ /dev/null @@ -1 +0,0 @@ -rename `Python::assume_gil_acquired` to `Python::assume_attached` \ No newline at end of file diff --git a/pyo3-build-config/Cargo.toml b/pyo3-build-config/Cargo.toml index 8315dae6747..719a42e7974 100644 --- a/pyo3-build-config/Cargo.toml +++ b/pyo3-build-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-build-config" -version = "0.25.1" +version = "0.26.0" description = "Build configuration for the PyO3 ecosystem" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] diff --git a/pyo3-ffi/Cargo.toml b/pyo3-ffi/Cargo.toml index 3ce95cacf3d..78197c7c263 100644 --- a/pyo3-ffi/Cargo.toml +++ b/pyo3-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-ffi" -version = "0.25.1" +version = "0.26.0" description = "Python-API bindings for the PyO3 ecosystem" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -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.1", features = ["resolve-config"] } +pyo3-build-config = { path = "../pyo3-build-config", version = "=0.26.0", features = ["resolve-config"] } [lints] workspace = true diff --git a/pyo3-ffi/README.md b/pyo3-ffi/README.md index 30623cc50f1..0f6bc8d9533 100644 --- a/pyo3-ffi/README.md +++ b/pyo3-ffi/README.md @@ -41,13 +41,13 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies.pyo3-ffi] -version = "0.25.1" +version = "0.26.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.25.1" +pyo3_build_config = "0.26.0" ``` If you need to use conditional compilation based on Python version or how diff --git a/pyo3-introspection/Cargo.toml b/pyo3-introspection/Cargo.toml index 74d9edf24ae..0aa76535cc6 100644 --- a/pyo3-introspection/Cargo.toml +++ b/pyo3-introspection/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-introspection" -version = "0.25.1" +version = "0.26.0" description = "Introspect dynamic libraries built with PyO3 to get metadata about the exported Python types" authors = ["PyO3 Project and Contributors "] homepage = "https://github.com/pyo3/pyo3" diff --git a/pyo3-macros-backend/Cargo.toml b/pyo3-macros-backend/Cargo.toml index a85caac82f7..02a2c39f238 100644 --- a/pyo3-macros-backend/Cargo.toml +++ b/pyo3-macros-backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-macros-backend" -version = "0.25.1" +version = "0.26.0" description = "Code generation for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -17,7 +17,7 @@ rust-version.workspace = true [dependencies] heck = "0.5" proc-macro2 = { version = "1.0.60", default-features = false } -pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.1", features = ["resolve-config"] } +pyo3-build-config = { path = "../pyo3-build-config", version = "=0.26.0", features = ["resolve-config"] } quote = { version = "1", default-features = false } [dependencies.syn] @@ -27,7 +27,7 @@ default-features = false features = ["derive", "parsing", "printing", "clone-impls", "full", "extra-traits", "visit-mut"] [build-dependencies] -pyo3-build-config = { path = "../pyo3-build-config", version = "=0.25.1" } +pyo3-build-config = { path = "../pyo3-build-config", version = "=0.26.0" } [lints] workspace = true diff --git a/pyo3-macros/Cargo.toml b/pyo3-macros/Cargo.toml index 0e1d6d725c3..8b7f19634b0 100644 --- a/pyo3-macros/Cargo.toml +++ b/pyo3-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-macros" -version = "0.25.1" +version = "0.26.0" description = "Proc macros for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -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.1" } +pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.26.0" } [lints] workspace = true diff --git a/pyproject.toml b/pyproject.toml index 48316a920a5..5dc682ea044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ [tool.towncrier] filename = "CHANGELOG.md" -version = "0.25.1" +version = "0.26.0" start_string = "\n" template = ".towncrier.template.md" title_format = "## [{version}] - {project_date}" diff --git a/tests/ui/reject_generics.stderr b/tests/ui/reject_generics.stderr index 02db8433838..5c759ac8a20 100644 --- a/tests/ui/reject_generics.stderr +++ b/tests/ui/reject_generics.stderr @@ -1,10 +1,10 @@ -error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.25.1/class.html#no-generic-parameters +error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.26.0/class.html#no-generic-parameters --> tests/ui/reject_generics.rs:4:25 | 4 | struct ClassWithGenerics { | ^ -error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.25.1/class.html#no-lifetime-parameters +error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.26.0/class.html#no-lifetime-parameters --> tests/ui/reject_generics.rs:9:27 | 9 | struct ClassWithLifetimes<'a> {