From 9ef417f5cb27644424533070b363b406e78155f5 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Fri, 9 Oct 2026 11:24:24 +0100 Subject: [PATCH] release: 0.30.0 --- CHANGELOG.md | 73 ++++++++++++++++++- 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 +- guide/src/building-and-distribution.md | 4 +- newsfragments/6056.added.md | 1 - newsfragments/6128.packaging.md | 1 - newsfragments/6144.changed.md | 1 - newsfragments/6152.added.md | 1 - newsfragments/6174.added.md | 1 - newsfragments/6188.changed.md | 2 - newsfragments/6188.removed.md | 1 - newsfragments/6192.changed.md | 3 - newsfragments/6200.changed.md | 1 - newsfragments/6204.added.md | 1 - newsfragments/6227.added.md | 3 - newsfragments/6242.fixed.md | 2 - newsfragments/6251.changed.md | 1 - newsfragments/6262.added.md | 1 - newsfragments/6269.fixed.md | 1 - newsfragments/6271.added.1.md | 2 - newsfragments/6271.added.md | 1 - newsfragments/6299.added.md | 1 - newsfragments/6324.changed.1.md | 1 - newsfragments/6324.changed.md | 1 - newsfragments/6349.added.md | 3 - newsfragments/6350.added.md | 1 - newsfragments/6351.added.md | 1 - newsfragments/6360.fixed.md | 1 - newsfragments/6362.added.md | 1 - newsfragments/6381.changed.md | 1 - newsfragments/6382.added.md | 1 - newsfragments/6396.fixed.md | 1 - newsfragments/6412.added.md | 1 - newsfragments/6413.fixed.md | 3 - newsfragments/6420.fixed.md | 1 - newsfragments/6424.fixed.md | 1 - newsfragments/6425.fixed.md | 1 - newsfragments/6428.fixed.md | 1 - newsfragments/6429.added.md | 1 - newsfragments/6437.added.md | 1 - newsfragments/6446.changed.md | 1 - newsfragments/6450.fixed.md | 1 - newsfragments/6452.changed.md | 1 - newsfragments/6454.fixed.md | 1 - newsfragments/6455.added.md | 1 - newsfragments/6459.packaging.md | 1 - newsfragments/6474.changed.md | 1 - newsfragments/6483.packaging.md | 1 - newsfragments/6491.packaging.md | 1 - newsfragments/6517.packaging.md | 1 - newsfragments/6519.removed.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 | 2 +- pyo3-macros/Cargo.toml | 4 +- pyproject.toml | 2 +- tests/ui/base/Cargo.toml | 2 +- tests/ui/reject_generics.stderr | 4 +- 65 files changed, 98 insertions(+), 85 deletions(-) delete mode 100644 newsfragments/6056.added.md delete mode 100644 newsfragments/6128.packaging.md delete mode 100644 newsfragments/6144.changed.md delete mode 100644 newsfragments/6152.added.md delete mode 100644 newsfragments/6174.added.md delete mode 100644 newsfragments/6188.changed.md delete mode 100644 newsfragments/6188.removed.md delete mode 100644 newsfragments/6192.changed.md delete mode 100644 newsfragments/6200.changed.md delete mode 100644 newsfragments/6204.added.md delete mode 100644 newsfragments/6227.added.md delete mode 100644 newsfragments/6242.fixed.md delete mode 100644 newsfragments/6251.changed.md delete mode 100644 newsfragments/6262.added.md delete mode 100644 newsfragments/6269.fixed.md delete mode 100644 newsfragments/6271.added.1.md delete mode 100644 newsfragments/6271.added.md delete mode 100644 newsfragments/6299.added.md delete mode 100644 newsfragments/6324.changed.1.md delete mode 100644 newsfragments/6324.changed.md delete mode 100644 newsfragments/6349.added.md delete mode 100644 newsfragments/6350.added.md delete mode 100644 newsfragments/6351.added.md delete mode 100644 newsfragments/6360.fixed.md delete mode 100644 newsfragments/6362.added.md delete mode 100644 newsfragments/6381.changed.md delete mode 100644 newsfragments/6382.added.md delete mode 100644 newsfragments/6396.fixed.md delete mode 100644 newsfragments/6412.added.md delete mode 100644 newsfragments/6413.fixed.md delete mode 100644 newsfragments/6420.fixed.md delete mode 100644 newsfragments/6424.fixed.md delete mode 100644 newsfragments/6425.fixed.md delete mode 100644 newsfragments/6428.fixed.md delete mode 100644 newsfragments/6429.added.md delete mode 100644 newsfragments/6437.added.md delete mode 100644 newsfragments/6446.changed.md delete mode 100644 newsfragments/6450.fixed.md delete mode 100644 newsfragments/6452.changed.md delete mode 100644 newsfragments/6454.fixed.md delete mode 100644 newsfragments/6455.added.md delete mode 100644 newsfragments/6459.packaging.md delete mode 100644 newsfragments/6474.changed.md delete mode 100644 newsfragments/6483.packaging.md delete mode 100644 newsfragments/6491.packaging.md delete mode 100644 newsfragments/6517.packaging.md delete mode 100644 newsfragments/6519.removed.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa15d61fb3..750be9dc4a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,76 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h +## [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` 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`). [#6271](https://github.com/PyO3/pyo3/pull/6271) +- Change `#[pymodule_init]` on fallible functions to only accept `Result<(), E>` (previously accepted any `Result` 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; 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 @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 0270adeb4b3..3b39f043dec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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/" @@ -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 } @@ -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"] diff --git a/README.md b/README.md index 27e2b960fb4..7f92805cd48 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies] -pyo3 = "0.29.3" +pyo3 = "0.30.0" ``` **`src/lib.rs`** @@ -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"] ``` diff --git a/examples/decorator/.template/pre-script.rhai b/examples/decorator/.template/pre-script.rhai index 0541eb61f58..a9c7c9494f4 100644 --- a/examples/decorator/.template/pre-script.rhai +++ b/examples/decorator/.template/pre-script.rhai @@ -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"); diff --git a/examples/maturin-starter/.template/pre-script.rhai b/examples/maturin-starter/.template/pre-script.rhai index 0541eb61f58..a9c7c9494f4 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.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"); diff --git a/examples/plugin/.template/pre-script.rhai b/examples/plugin/.template/pre-script.rhai index 1019f600eb0..6d8e474757d 100644 --- a/examples/plugin/.template/pre-script.rhai +++ b/examples/plugin/.template/pre-script.rhai @@ -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"); diff --git a/examples/setuptools-rust-starter/.template/pre-script.rhai b/examples/setuptools-rust-starter/.template/pre-script.rhai index 1b209f72400..25a28c6aca3 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.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"); diff --git a/examples/word-count/.template/pre-script.rhai b/examples/word-count/.template/pre-script.rhai index 0541eb61f58..a9c7c9494f4 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.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"); diff --git a/guide/src/building-and-distribution.md b/guide/src/building-and-distribution.md index 95778633fe6..9e9caab5890 100644 --- a/guide/src/building-and-distribution.md +++ b/guide/src/building-and-distribution.md @@ -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) diff --git a/newsfragments/6056.added.md b/newsfragments/6056.added.md deleted file mode 100644 index e3e75585b2a..00000000000 --- a/newsfragments/6056.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `PyThread_get_thread_ident` to the ffi crate when not using PyPy diff --git a/newsfragments/6128.packaging.md b/newsfragments/6128.packaging.md deleted file mode 100644 index 50f0008c677..00000000000 --- a/newsfragments/6128.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Drop support for Python 3.8. diff --git a/newsfragments/6144.changed.md b/newsfragments/6144.changed.md deleted file mode 100644 index 1df1e9e5efc..00000000000 --- a/newsfragments/6144.changed.md +++ /dev/null @@ -1 +0,0 @@ -Optimized `num-bigint` conversions on Python 3.14 and newer. diff --git a/newsfragments/6152.added.md b/newsfragments/6152.added.md deleted file mode 100644 index f812e82d66c..00000000000 --- a/newsfragments/6152.added.md +++ /dev/null @@ -1 +0,0 @@ -Add init config to `ffi` crate diff --git a/newsfragments/6174.added.md b/newsfragments/6174.added.md deleted file mode 100644 index 2570cc8b00f..00000000000 --- a/newsfragments/6174.added.md +++ /dev/null @@ -1 +0,0 @@ -Add support for `PyFrozenDict` on 3.15+ \ No newline at end of file diff --git a/newsfragments/6188.changed.md b/newsfragments/6188.changed.md deleted file mode 100644 index 858e004b47e..00000000000 --- a/newsfragments/6188.changed.md +++ /dev/null @@ -1,2 +0,0 @@ -switched the default pyclass behavior to not emit `FromPyObject` implementation (previously deprecated) -deprecated `skip_from_py_object` pyclass option (as is is now the default) diff --git a/newsfragments/6188.removed.md b/newsfragments/6188.removed.md deleted file mode 100644 index 522d382bd53..00000000000 --- a/newsfragments/6188.removed.md +++ /dev/null @@ -1 +0,0 @@ -removed deprecated `FromPyObject` blanket implementation diff --git a/newsfragments/6192.changed.md b/newsfragments/6192.changed.md deleted file mode 100644 index 618411b8732..00000000000 --- a/newsfragments/6192.changed.md +++ /dev/null @@ -1,3 +0,0 @@ -Deprecate `PythonAbi::from_build_env` in favor of a new `PythonAbi::from_stable_abi` constructor, which takes the stable ABI kind and minimum version explicitly instead of reading the `abi3`/`abi3t` cargo features from the environment (feature-based selection is now internal to PyO3's build scripts). - -`InterpreterConfig::from_sysconfigdata` no longer selects a target ABI based on the content of abi3 or abi3t cargo features and will select a version-specific ABI instead. diff --git a/newsfragments/6200.changed.md b/newsfragments/6200.changed.md deleted file mode 100644 index 0990e52686e..00000000000 --- a/newsfragments/6200.changed.md +++ /dev/null @@ -1 +0,0 @@ -Skip the deferred-decref pool's mutex on attach when no decrefs are pending. Attaching no longer serializes on a global mutex, which could cause excessive context switching in multithreaded free-threaded scenarios. diff --git a/newsfragments/6204.added.md b/newsfragments/6204.added.md deleted file mode 100644 index ebb7b791943..00000000000 --- a/newsfragments/6204.added.md +++ /dev/null @@ -1 +0,0 @@ -Add FFI definitions `PyContext_AddWatcher` and `PyContext_ClearWatcher` on Python 3.14+. diff --git a/newsfragments/6227.added.md b/newsfragments/6227.added.md deleted file mode 100644 index f32e9de12be..00000000000 --- a/newsfragments/6227.added.md +++ /dev/null @@ -1,3 +0,0 @@ -Add `PyContext`, as well as `PyContext::add_watcher`, `watch_callback!`, `ContextEvent`, -`BoundContextWatcherGuard`, and `ContextWatcherGuard` for watching `contextvars.Context` on -GIL-enabled CPython 3.14+. `PyContext` itself is available on all supported CPython versions. diff --git a/newsfragments/6242.fixed.md b/newsfragments/6242.fixed.md deleted file mode 100644 index d2d2c8cf3a8..00000000000 --- a/newsfragments/6242.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -`experimental-inspect`: generate the `__all__` declaration of complete modules in the type stubs, matching the `__all__` that `#[pymodule]` builds at runtime. -It is placed directly after the imports, following the conventions used by `typeshed`, and lists the members in the order the stub declares them. diff --git a/newsfragments/6251.changed.md b/newsfragments/6251.changed.md deleted file mode 100644 index eaa183ea3ab..00000000000 --- a/newsfragments/6251.changed.md +++ /dev/null @@ -1 +0,0 @@ -`PyBytes::new_with_writer` accepts function that takes `&mut PyBytesWriter` instead of `&mut dyn Write` diff --git a/newsfragments/6262.added.md b/newsfragments/6262.added.md deleted file mode 100644 index 8c1452089dc..00000000000 --- a/newsfragments/6262.added.md +++ /dev/null @@ -1 +0,0 @@ -Add tss api to ffi crate diff --git a/newsfragments/6269.fixed.md b/newsfragments/6269.fixed.md deleted file mode 100644 index ef16ee89410..00000000000 --- a/newsfragments/6269.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix possible memory leak of `#[pyclass]` types due PyO3 missing a traversal needed for the garbage collector. diff --git a/newsfragments/6271.added.1.md b/newsfragments/6271.added.1.md deleted file mode 100644 index 84d287c68c2..00000000000 --- a/newsfragments/6271.added.1.md +++ /dev/null @@ -1,2 +0,0 @@ -A `#[pymodule_init]` function may now return `()` instead of `PyResult<()>`, which is useful for initialisers which cannot fail. -The return type is now checked: an initialiser returning a `Result` with a non-unit `Ok` value used to compile, with that value silently discarded, and is now rejected. diff --git a/newsfragments/6271.added.md b/newsfragments/6271.added.md deleted file mode 100644 index c36bef2287d..00000000000 --- a/newsfragments/6271.added.md +++ /dev/null @@ -1 +0,0 @@ -`#[pymodule_init]` may now be written without the module argument, and may take a `Python<'_>` marker in front of it or instead of it. An initialiser which is not handed the module leaves it complete, so with `experimental-inspect` the module is no longer tagged incomplete and its stubs no longer get a `def __getattr__(name: str) -> Incomplete: ...` catch-all. diff --git a/newsfragments/6299.added.md b/newsfragments/6299.added.md deleted file mode 100644 index 61abf331832..00000000000 --- a/newsfragments/6299.added.md +++ /dev/null @@ -1 +0,0 @@ -Enable FFI definitions `PyObject_GC_Track` and `PyObject_GC_UnTrack` on PyPy. diff --git a/newsfragments/6324.changed.1.md b/newsfragments/6324.changed.1.md deleted file mode 100644 index 80d52ab0777..00000000000 --- a/newsfragments/6324.changed.1.md +++ /dev/null @@ -1 +0,0 @@ -`pyo3::types::PyMutex` and `pyo3::types::PyMutexGuard` have been moved to `pyo3::sync`. Deprecated aliases are temporarily available in `pyo3::types`. diff --git a/newsfragments/6324.changed.md b/newsfragments/6324.changed.md deleted file mode 100644 index 25c38d354c2..00000000000 --- a/newsfragments/6324.changed.md +++ /dev/null @@ -1 +0,0 @@ -`pyo3::types` module now has additional submodules, 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`. diff --git a/newsfragments/6349.added.md b/newsfragments/6349.added.md deleted file mode 100644 index 25eba6778e2..00000000000 --- a/newsfragments/6349.added.md +++ /dev/null @@ -1,3 +0,0 @@ -Add the following to `unicodeobject.rs‎`: - -* PyUnicode_DecodeMBCS, PyUnicode_DecodeMBCSStateful, PyUnicode_DecodeCodePagetateful, PyUnicode_AsMBCSString, PyUnicode_EncodeCodePage, PyUnicode_Equal diff --git a/newsfragments/6350.added.md b/newsfragments/6350.added.md deleted file mode 100644 index ce1e182eb43..00000000000 --- a/newsfragments/6350.added.md +++ /dev/null @@ -1 +0,0 @@ -Add these functions to the non-limited API: PyFloat_Pack{2,4,8} and PyFloat_Unpack{2,4,8} diff --git a/newsfragments/6351.added.md b/newsfragments/6351.added.md deleted file mode 100644 index b37c5dcf9c4..00000000000 --- a/newsfragments/6351.added.md +++ /dev/null @@ -1 +0,0 @@ -Add various accessors for Python's function object diff --git a/newsfragments/6360.fixed.md b/newsfragments/6360.fixed.md deleted file mode 100644 index 9861eeda2b0..00000000000 --- a/newsfragments/6360.fixed.md +++ /dev/null @@ -1 +0,0 @@ -`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. diff --git a/newsfragments/6362.added.md b/newsfragments/6362.added.md deleted file mode 100644 index 66f70f53ca1..00000000000 --- a/newsfragments/6362.added.md +++ /dev/null @@ -1 +0,0 @@ -`experimental-inspect`: classes which extend their base's instance layout are now decorated with `disjoint_base` in the generated stubs, following [PEP 800](https://peps.python.org/pep-0800/). It is imported from `typing` when targeting Python 3.15 or newer and from `typing_extensions` otherwise. diff --git a/newsfragments/6381.changed.md b/newsfragments/6381.changed.md deleted file mode 100644 index b26f5cc6541..00000000000 --- a/newsfragments/6381.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecated unsound methods of `PyBuffer`: `as_slice`, `as_mut_slice`, `as_fortran_slice`, and `as_fortran_mut_slice`. diff --git a/newsfragments/6382.added.md b/newsfragments/6382.added.md deleted file mode 100644 index 996f5d79e20..00000000000 --- a/newsfragments/6382.added.md +++ /dev/null @@ -1 +0,0 @@ -Add methods `as_slice_ptr` and `as_fortran_slice_ptr` to `PyBuffer`. diff --git a/newsfragments/6396.fixed.md b/newsfragments/6396.fixed.md deleted file mode 100644 index d66f3e261ee..00000000000 --- a/newsfragments/6396.fixed.md +++ /dev/null @@ -1 +0,0 @@ -`experimental-inspect`: annotate integer inputs as `SupportsIndex` and float inputs as `SupportsFloat | SupportsIndex`, so that e.g. NumPy scalars are also accepted. diff --git a/newsfragments/6412.added.md b/newsfragments/6412.added.md deleted file mode 100644 index 2b552372fff..00000000000 --- a/newsfragments/6412.added.md +++ /dev/null @@ -1 +0,0 @@ -Implement `Copy` for `PyVisit`. diff --git a/newsfragments/6413.fixed.md b/newsfragments/6413.fixed.md deleted file mode 100644 index f1b176c04a3..00000000000 --- a/newsfragments/6413.fixed.md +++ /dev/null @@ -1,3 +0,0 @@ -`experimental-inspect`: annotate `Vec`, `[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. diff --git a/newsfragments/6420.fixed.md b/newsfragments/6420.fixed.md deleted file mode 100644 index 0d92d43211c..00000000000 --- a/newsfragments/6420.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix reference to type object receiver for `#[classmethod]` dunder methods not being kept alive for the full function call. diff --git a/newsfragments/6424.fixed.md b/newsfragments/6424.fixed.md deleted file mode 100644 index 2d75f7bea7a..00000000000 --- a/newsfragments/6424.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixed `experimental-inspect` stub generation panicking on a class named like its root module, and no longer aliasing a builtin with that name. diff --git a/newsfragments/6425.fixed.md b/newsfragments/6425.fixed.md deleted file mode 100644 index 373fd8aa988..00000000000 --- a/newsfragments/6425.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixed a panic in `experimental-inspect` stub generation when a default value or attribute value references a name that appears in no annotation. diff --git a/newsfragments/6428.fixed.md b/newsfragments/6428.fixed.md deleted file mode 100644 index 6f4c376f742..00000000000 --- a/newsfragments/6428.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix `#[pyfunction]` being marked `METH_STATIC` since PyO3 0.28, which made `__self__` `None` and calls slower on CPython 3.11+. diff --git a/newsfragments/6429.added.md b/newsfragments/6429.added.md deleted file mode 100644 index 94a2b304047..00000000000 --- a/newsfragments/6429.added.md +++ /dev/null @@ -1 +0,0 @@ -Add pypy3.12 dll to list of ffi sources diff --git a/newsfragments/6437.added.md b/newsfragments/6437.added.md deleted file mode 100644 index 809bca51ec9..00000000000 --- a/newsfragments/6437.added.md +++ /dev/null @@ -1 +0,0 @@ -Add non poisoning variant of `PyMutex` diff --git a/newsfragments/6446.changed.md b/newsfragments/6446.changed.md deleted file mode 100644 index 6680e7b2402..00000000000 --- a/newsfragments/6446.changed.md +++ /dev/null @@ -1 +0,0 @@ -Intern dict keys in derived IntoPyObject / IntoPyObjectRef diff --git a/newsfragments/6450.fixed.md b/newsfragments/6450.fixed.md deleted file mode 100644 index 4d09cebb1b2..00000000000 --- a/newsfragments/6450.fixed.md +++ /dev/null @@ -1 +0,0 @@ -fix `jiff::Zoned` extraction for nonexistent datetimes in transition gap diff --git a/newsfragments/6452.changed.md b/newsfragments/6452.changed.md deleted file mode 100644 index b621b0b5c7e..00000000000 --- a/newsfragments/6452.changed.md +++ /dev/null @@ -1 +0,0 @@ -Make datetime `Access` traits available on abi3 diff --git a/newsfragments/6454.fixed.md b/newsfragments/6454.fixed.md deleted file mode 100644 index 7b5d287e125..00000000000 --- a/newsfragments/6454.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix cases where the default library name selected by PyO3 would not respect `Py_DEBUG` build flag. diff --git a/newsfragments/6455.added.md b/newsfragments/6455.added.md deleted file mode 100644 index 7174df92d6d..00000000000 --- a/newsfragments/6455.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `PyStringMethods::code_point_len`, which returns the length Python stores for a string without calling a subclass's `__len__`. diff --git a/newsfragments/6459.packaging.md b/newsfragments/6459.packaging.md deleted file mode 100644 index 180dc7d5db1..00000000000 --- a/newsfragments/6459.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Bump MSRV to 1.85. diff --git a/newsfragments/6474.changed.md b/newsfragments/6474.changed.md deleted file mode 100644 index 6b11c2f5040..00000000000 --- a/newsfragments/6474.changed.md +++ /dev/null @@ -1 +0,0 @@ -Inline trivial inner functions into their generic methods diff --git a/newsfragments/6483.packaging.md b/newsfragments/6483.packaging.md deleted file mode 100644 index 59d9a22edbf..00000000000 --- a/newsfragments/6483.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Support `meson-python` as a build backend. diff --git a/newsfragments/6491.packaging.md b/newsfragments/6491.packaging.md deleted file mode 100644 index a87df92814b..00000000000 --- a/newsfragments/6491.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Bump minimum supported GraalPy version to 25.4. diff --git a/newsfragments/6517.packaging.md b/newsfragments/6517.packaging.md deleted file mode 100644 index 59ea8a1a5bc..00000000000 --- a/newsfragments/6517.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Support Python 3.15.0 final. diff --git a/newsfragments/6519.removed.md b/newsfragments/6519.removed.md deleted file mode 100644 index 87a89050119..00000000000 --- a/newsfragments/6519.removed.md +++ /dev/null @@ -1 +0,0 @@ -Remove all functionality deprecated in PyO3 0.28. diff --git a/pyo3-build-config/Cargo.toml b/pyo3-build-config/Cargo.toml index 58c65f9f22b..01236e6851d 100644 --- a/pyo3-build-config/Cargo.toml +++ b/pyo3-build-config/Cargo.toml @@ -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 diff --git a/pyo3-ffi/Cargo.toml b/pyo3-ffi/Cargo.toml index 8a8bf48252c..0b3895d77ed 100644 --- a/pyo3-ffi/Cargo.toml +++ b/pyo3-ffi/Cargo.toml @@ -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 @@ -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 diff --git a/pyo3-ffi/README.md b/pyo3-ffi/README.md index 7b79f339967..105fc12193d 100644 --- a/pyo3-ffi/README.md +++ b/pyo3-ffi/README.md @@ -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 diff --git a/pyo3-introspection/Cargo.toml b/pyo3-introspection/Cargo.toml index b08d73acde1..eda4d013135 100644 --- a/pyo3-introspection/Cargo.toml +++ b/pyo3-introspection/Cargo.toml @@ -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 diff --git a/pyo3-macros-backend/Cargo.toml b/pyo3-macros-backend/Cargo.toml index 6b2ff9882ac..431ac10e402 100644 --- a/pyo3-macros-backend/Cargo.toml +++ b/pyo3-macros-backend/Cargo.toml @@ -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 diff --git a/pyo3-macros/Cargo.toml b/pyo3-macros/Cargo.toml index 769acaff9dd..196666e227c 100644 --- a/pyo3-macros/Cargo.toml +++ b/pyo3-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-macros" -version = "0.29.3" +version = "0.30.0" description = "Proc macros for PyO3 package" authors.workspace = true keywords.workspace = true @@ -23,7 +23,7 @@ experimental-inspect = ["pyo3-macros-backend/experimental-inspect"] proc-macro2 = { version = "1.0.60", default-features = false } quote = "1" syn = { version = "3", features = ["full", "extra-traits"] } -pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.29.3" } +pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.30.0" } [lints] workspace = true diff --git a/pyproject.toml b/pyproject.toml index 5596788d48c..a917dafa0f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dynamic = ["version"] [tool.towncrier] filename = "CHANGELOG.md" -version = "0.29.3" +version = "0.30.0" start_string = "\n" template = ".towncrier.template.md" title_format = "## [{version}] - {project_date}" diff --git a/tests/ui/base/Cargo.toml b/tests/ui/base/Cargo.toml index 663f599ab10..ef8a52fe66e 100644 --- a/tests/ui/base/Cargo.toml +++ b/tests/ui/base/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -pyo3 = { version = "0.29.3", default-features = false, path = "../../../" } +pyo3 = { version = "0.30.0", default-features = false, path = "../../../" } [features] macros = ["pyo3/macros"] diff --git a/tests/ui/reject_generics.stderr b/tests/ui/reject_generics.stderr index ad286e0320b..3fa1570c2a5 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.29.3/class.html#no-generic-parameters +error: #[pyclass] cannot have generic parameters. For an explanation, see https://pyo3.rs/v0.30.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.29.3/class.html#no-lifetime-parameters +error: #[pyclass] cannot have lifetime parameters. For an explanation, see https://pyo3.rs/v0.30.0/class.html#no-lifetime-parameters --> tests/ui/reject_generics.rs:10:27 | 10 | struct ClassWithLifetimes<'a> {