From c77deee18ec545b3b5fa480068e5da62a33e7c42 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:05:02 +0100 Subject: [PATCH] release: 0.20.0 --- CHANGELOG.md | 69 ++++++++++++++++++- Cargo.toml | 8 +-- README.md | 4 +- examples/Cargo.toml | 2 +- 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/3108.packaging.md | 1 - newsfragments/3203.added.md | 1 - newsfragments/3208.packaging.md | 1 - newsfragments/3222.added.md | 1 - newsfragments/3232.removed.md | 1 - newsfragments/3237.packaging.md | 1 - newsfragments/3239.packaging.md | 1 - newsfragments/3281.changed.md | 1 - newsfragments/3281.fixed.md | 1 - newsfragments/3321.changed.md | 1 - newsfragments/3330.changed.md | 1 - newsfragments/3336.added.md | 1 - newsfragments/3336.changed.md | 1 - newsfragments/3358.changed.md | 1 - newsfragments/3359.added.md | 1 - newsfragments/3366.added.md | 1 - newsfragments/3366.fixed.md | 1 - newsfragments/3374.added.md | 1 - newsfragments/3374.fixed.md | 1 - newsfragments/3378.changed.md | 1 - newsfragments/3379.changed.md | 1 - newsfragments/3384.added.md | 1 - newsfragments/3385.removed.md | 1 - newsfragments/3387.packaging.md | 1 - newsfragments/3389.changed.md | 1 - newsfragments/3391.changed.md | 1 - newsfragments/3393.changed.md | 1 - newsfragments/3396.changed.md | 1 - newsfragments/3397.changed.md | 1 - newsfragments/3401.fixed.md | 1 - newsfragments/3402.changed.md | 1 - newsfragments/3403.added.md | 1 - newsfragments/3403.fixed.md | 1 - newsfragments/3404.fixed.md | 1 - newsfragments/3405.fixed.md | 1 - newsfragments/3408.added.md | 1 - newsfragments/3427.packaging.md | 1 - newsfragments/3446.changed.md | 1 - newsfragments/3455.changed.md | 1 - newsfragments/3458.changed.md | 1 - newsfragments/3461.fixed.md | 1 - newsfragments/3471.fixed.md | 1 - newsfragments/3484.fixed.md | 1 - newsfragments/3488.packaging.md | 1 - newsfragments/3490.fixed.md | 1 - newsfragments/3491.fixed.md | 1 - newsfragments/3494.added.md | 1 - newsfragments/3500.fixed.md | 2 - newsfragments/3502.added.md | 1 - newsfragments/3505.changed.md | 1 - pyo3-build-config/Cargo.toml | 2 +- pyo3-ffi/Cargo.toml | 4 +- pyo3-macros-backend/Cargo.toml | 2 +- pyo3-macros/Cargo.toml | 4 +- pyproject.toml | 2 +- 64 files changed, 87 insertions(+), 71 deletions(-) delete mode 100644 newsfragments/3108.packaging.md delete mode 100644 newsfragments/3203.added.md delete mode 100644 newsfragments/3208.packaging.md delete mode 100644 newsfragments/3222.added.md delete mode 100644 newsfragments/3232.removed.md delete mode 100644 newsfragments/3237.packaging.md delete mode 100644 newsfragments/3239.packaging.md delete mode 100644 newsfragments/3281.changed.md delete mode 100644 newsfragments/3281.fixed.md delete mode 100644 newsfragments/3321.changed.md delete mode 100644 newsfragments/3330.changed.md delete mode 100644 newsfragments/3336.added.md delete mode 100644 newsfragments/3336.changed.md delete mode 100644 newsfragments/3358.changed.md delete mode 100644 newsfragments/3359.added.md delete mode 100644 newsfragments/3366.added.md delete mode 100644 newsfragments/3366.fixed.md delete mode 100644 newsfragments/3374.added.md delete mode 100644 newsfragments/3374.fixed.md delete mode 100644 newsfragments/3378.changed.md delete mode 100644 newsfragments/3379.changed.md delete mode 100644 newsfragments/3384.added.md delete mode 100644 newsfragments/3385.removed.md delete mode 100644 newsfragments/3387.packaging.md delete mode 100644 newsfragments/3389.changed.md delete mode 100644 newsfragments/3391.changed.md delete mode 100644 newsfragments/3393.changed.md delete mode 100644 newsfragments/3396.changed.md delete mode 100644 newsfragments/3397.changed.md delete mode 100644 newsfragments/3401.fixed.md delete mode 100644 newsfragments/3402.changed.md delete mode 100644 newsfragments/3403.added.md delete mode 100644 newsfragments/3403.fixed.md delete mode 100644 newsfragments/3404.fixed.md delete mode 100644 newsfragments/3405.fixed.md delete mode 100644 newsfragments/3408.added.md delete mode 100644 newsfragments/3427.packaging.md delete mode 100644 newsfragments/3446.changed.md delete mode 100644 newsfragments/3455.changed.md delete mode 100644 newsfragments/3458.changed.md delete mode 100644 newsfragments/3461.fixed.md delete mode 100644 newsfragments/3471.fixed.md delete mode 100644 newsfragments/3484.fixed.md delete mode 100644 newsfragments/3488.packaging.md delete mode 100644 newsfragments/3490.fixed.md delete mode 100644 newsfragments/3491.fixed.md delete mode 100644 newsfragments/3494.added.md delete mode 100644 newsfragments/3500.fixed.md delete mode 100644 newsfragments/3502.added.md delete mode 100644 newsfragments/3505.changed.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e4e3dafb4..97ce9a00537 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,72 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h +## [0.20.0] - 2023-10-11 + +### Packaging + +- Dual-license PyO3 under either the Apache 2.0 OR the MIT license. This makes the project GPLv2 compatible. [#3108](https://github.com/PyO3/pyo3/pull/3108) +- Update MSRV to Rust 1.56. [#3208](https://github.com/PyO3/pyo3/pull/3208) +- Bump `indoc` dependency to 2.0 and `unindent` dependency to 0.2. [#3237](https://github.com/PyO3/pyo3/pull/3237) +- Bump `syn` dependency to 2.0. [#3239](https://github.com/PyO3/pyo3/pull/3239) +- Drop support for debug builds of Python 3.7. [#3387](https://github.com/PyO3/pyo3/pull/3387) +- Bump `chrono` optional dependency to require 0.4.25 or newer. [#3427](https://github.com/PyO3/pyo3/pull/3427) +- Support Python 3.12. [#3488](https://github.com/PyO3/pyo3/pull/3488) + +### Added + +- Support `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__` in `#[pymethods]`. [#3203](https://github.com/PyO3/pyo3/pull/3203) +- Add FFI definition `Py_GETENV`. [#3336](https://github.com/PyO3/pyo3/pull/3336) +- Add `as_ptr` and `into_ptr` inherent methods for `Py`, `PyAny`, `PyRef`, and `PyRefMut`. [#3359](https://github.com/PyO3/pyo3/pull/3359) +- Implement `DoubleEndedIterator` for `PyTupleIterator` and `PyListIterator`. [#3366](https://github.com/PyO3/pyo3/pull/3366) +- Add `#[pyclass(rename_all = "...")]` option: this allows renaming all getters and setters of a struct, or all variants of an enum. Available renaming rules are: `"camelCase"`, `"kebab-case"`, `"lowercase"`, `"PascalCase"`, `"SCREAMING-KEBAB-CASE"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"UPPERCASE"`. [#3384](https://github.com/PyO3/pyo3/pull/3384) +- Add FFI definitions `PyObject_GC_IsTracked` and `PyObject_GC_IsFinalized` on Python 3.9 and up (PyPy 3.10 and up). [#3403](https://github.com/PyO3/pyo3/pull/3403) +- Add types for `None`, `Ellipsis`, and `NotImplemented`. [#3408](https://github.com/PyO3/pyo3/pull/3408) +- Add FFI definitions for the `Py_mod_multiple_interpreters` constant and its possible values. [#3494](https://github.com/PyO3/pyo3/pull/3494) +- Add FFI definitions for `PyInterpreterConfig` struct, its constants and `Py_NewInterpreterFromConfig`. [#3502](https://github.com/PyO3/pyo3/pull/3502) + +### Changed + +- Change `PySet::discard` to return `PyResult` (previously returned nothing). [#3281](https://github.com/PyO3/pyo3/pull/3281) +- Optimize implmentation of `IntoPy` for Rust tuples to Python tuples. [#3321](https://github.com/PyO3/pyo3/pull/3321) +- Change `PyDict::get_item` to no longer suppress arbitrary exceptions (the return type is now `PyResult>` instead of `Option<&PyAny>`), and deprecate `PyDict::get_item_with_error`. [#3330](https://github.com/PyO3/pyo3/pull/3330) +- Deprecate FFI definitions which are deprecated in Python 3.12. [#3336](https://github.com/PyO3/pyo3/pull/3336) +- `AsPyPointer` is now an `unsafe trait`. [#3358](https://github.com/PyO3/pyo3/pull/3358) +- Accept all `os.PathLike` values in implementation of `FromPyObject` for `PathBuf`. [#3374](https://github.com/PyO3/pyo3/pull/3374) +- Add `__builtins__` to globals in `py.run()` and `py.eval()` if they're missing. [#3378](https://github.com/PyO3/pyo3/pull/3378) +- Optimize implementation of `FromPyObject` for `BigInt` and `BigUint`. [#3379](https://github.com/PyO3/pyo3/pull/3379) +- `PyIterator::from_object` and `PyByteArray::from` now take a single argument of type `&PyAny` (previously took two arguments `Python` and `AsPyPointer`). [#3389](https://github.com/PyO3/pyo3/pull/3389) +- Replace `AsPyPointer` with `AsRef` as a bound in the blanket implementation of `From<&T> for PyObject`. [#3391](https://github.com/PyO3/pyo3/pull/3391) +- Replace blanket `impl IntoPy for &T where T: AsPyPointer` with implementations of `impl IntoPy` for `&PyAny`, `&T where T: AsRef`, and `&Py`. [#3393](https://github.com/PyO3/pyo3/pull/3393) +- Preserve `std::io::Error` kind in implementation of `From` for `PyErr` [#3396](https://github.com/PyO3/pyo3/pull/3396) +- Try to select a relevant `ErrorKind` in implementation of `From` for `OSError` subclass. [#3397](https://github.com/PyO3/pyo3/pull/3397) +- Retrieve the original `PyErr` in implementation of `From` for `PyErr` if the `std::io::Error` has been built using a Python exception (previously would create a new exception wrapping the `std::io::Error`). [#3402](https://github.com/PyO3/pyo3/pull/3402) +- `#[pymodule]` will now return the same module object on repeated import by the same Python interpreter, on Python 3.9 and up. [#3446](https://github.com/PyO3/pyo3/pull/3446) +- Truncate leap-seconds and warn when converting `chrono` types to Python `datetime` types (`datetime` cannot represent leap-seconds). [#3458](https://github.com/PyO3/pyo3/pull/3458) +- `Err` returned from `#[pyfunction]` will now have a non-None `__context__` if called from inside a `catch` block. [#3455](https://github.com/PyO3/pyo3/pull/3455) +- Deprecate undocumented `#[__new__]` form of `#[new]` attribute. [#3505](https://github.com/PyO3/pyo3/pull/3505) + +### Removed + +- Remove all functionality deprecated in PyO3 0.18, including `#[args]` attribute for `#[pymethods]`. [#3232](https://github.com/PyO3/pyo3/pull/3232) +- Remove `IntoPyPointer` trait in favour of `into_ptr` inherent methods. [#3385](https://github.com/PyO3/pyo3/pull/3385) + +### Fixed + +- Handle exceptions properly in `PySet::discard`. [#3281](https://github.com/PyO3/pyo3/pull/3281) +- The `PyTupleIterator` type returned by `PyTuple::iter` is now public and hence can be named by downstream crates. [#3366](https://github.com/PyO3/pyo3/pull/3366) +- Linking of `PyOS_FSPath` on PyPy. [#3374](https://github.com/PyO3/pyo3/pull/3374) +- Fix memory leak in `PyTypeBuilder::build`. [#3401](https://github.com/PyO3/pyo3/pull/3401) +- Disable removed FFI definitions `_Py_GetAllocatedBlocks`, `_PyObject_GC_Malloc`, and `_PyObject_GC_Calloc` on Python 3.11 and up. [#3403](https://github.com/PyO3/pyo3/pull/3403) +- Fix `ResourceWarning` and crashes related to GC when running with debug builds of CPython. [#3404](https://github.com/PyO3/pyo3/pull/3404) +- Some-wrapping of `Option` default arguments will no longer re-wrap `Some(T)` or expressions evaluating to `None`. [#3461](https://github.com/PyO3/pyo3/pull/3461) +- Fix `IterNextOutput::Return` not returning a value on PyPy. [#3471](https://github.com/PyO3/pyo3/pull/3471) +- Emit compile errors instead of ignoring macro invocations inside `#[pymethods]` blocks. [#3491](https://github.com/PyO3/pyo3/pull/3491) +- Emit error on invalid arguments to `#[new]`, `#[classmethod]`, `#[staticmethod]`, and `#[classattr]`. [#3484](https://github.com/PyO3/pyo3/pull/3484) +- Disable `PyMarshal_WriteObjectToString` from `PyMarshal_ReadObjectFromString` with the `abi3` feature. [#3490](https://github.com/PyO3/pyo3/pull/3490) +- Fix FFI definitions for `_PyFrameEvalFunction` on Python 3.11 and up (it now receives a `_PyInterpreterFrame` opaque struct). [#3500](https://github.com/PyO3/pyo3/pull/3500) + + ## [0.19.2] - 2023-08-01 ### Added @@ -1533,7 +1599,8 @@ Yanked - Initial release -[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.19.2...HEAD +[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.20.0...HEAD +[0.20.0]: https://github.com/pyo3/pyo3/compare/v0.19.2...v0.20.0 [0.19.2]: https://github.com/pyo3/pyo3/compare/v0.19.1...v0.19.2 [0.19.1]: https://github.com/pyo3/pyo3/compare/v0.19.0...v0.19.1 [0.19.0]: https://github.com/pyo3/pyo3/compare/v0.18.3...v0.19.0 diff --git a/Cargo.toml b/Cargo.toml index 2871677754e..690072b1a6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3" -version = "0.19.2" +version = "0.20.0" description = "Bindings to Python interpreter" authors = ["PyO3 Project and Contributors "] readme = "README.md" @@ -21,10 +21,10 @@ parking_lot = ">= 0.11, < 0.13" memoffset = "0.9" # ffi bindings to the python interpreter, split into a separate crate so they can be used independently -pyo3-ffi = { path = "pyo3-ffi", version = "=0.19.2" } +pyo3-ffi = { path = "pyo3-ffi", version = "=0.20.0" } # support crates for macros feature -pyo3-macros = { path = "pyo3-macros", version = "=0.19.2", optional = true } +pyo3-macros = { path = "pyo3-macros", version = "=0.20.0", optional = true } indoc = { version = "2.0.1", optional = true } unindent = { version = "0.2.1", optional = true } @@ -56,7 +56,7 @@ rust_decimal = { version = "1.8.0", features = ["std"] } widestring = "0.5.1" [build-dependencies] -pyo3-build-config = { path = "pyo3-build-config", version = "0.19.2", features = ["resolve-config"] } +pyo3-build-config = { path = "pyo3-build-config", version = "0.20.0", features = ["resolve-config"] } [features] default = ["macros"] diff --git a/README.md b/README.md index a6b84a3192e..9f53285359e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.19.2", features = ["extension-module"] } +pyo3 = { version = "0.20.0", features = ["extension-module"] } ``` **`src/lib.rs`** @@ -137,7 +137,7 @@ Start a new project with `cargo new` and add `pyo3` to the `Cargo.toml` like th ```toml [dependencies.pyo3] -version = "0.19.2" +version = "0.20.0" features = ["auto-initialize"] ``` diff --git a/examples/Cargo.toml b/examples/Cargo.toml index d5072a30061..b210f0ee9a6 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -5,7 +5,7 @@ publish = false edition = "2021" [dev-dependencies] -pyo3 = { version = "0.19.2", path = "..", features = ["auto-initialize", "extension-module"] } +pyo3 = { version = "0.20.0", path = "..", features = ["auto-initialize", "extension-module"] } [[example]] name = "decorator" diff --git a/examples/decorator/.template/pre-script.rhai b/examples/decorator/.template/pre-script.rhai index d3341677b1f..5ba02b12ffd 100644 --- a/examples/decorator/.template/pre-script.rhai +++ b/examples/decorator/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.19.2"); +variable::set("PYO3_VERSION", "0.20.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 d3341677b1f..5ba02b12ffd 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.19.2"); +variable::set("PYO3_VERSION", "0.20.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 6ab231df25e..94a61826dc2 100644 --- a/examples/plugin/.template/pre-script.rhai +++ b/examples/plugin/.template/pre-script.rhai @@ -1,4 +1,4 @@ -variable::set("PYO3_VERSION", "0.19.2"); +variable::set("PYO3_VERSION", "0.20.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 b06e0f272b1..e4ede9b7aff 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.19.2"); +variable::set("PYO3_VERSION", "0.20.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 1349490d477..0748517e4f0 100644 --- a/examples/word-count/.template/pre-script.rhai +++ b/examples/word-count/.template/pre-script.rhai @@ -1,3 +1,3 @@ -variable::set("PYO3_VERSION", "0.19.2"); +variable::set("PYO3_VERSION", "0.20.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); file::delete(".template"); diff --git a/newsfragments/3108.packaging.md b/newsfragments/3108.packaging.md deleted file mode 100644 index e9b76ca4651..00000000000 --- a/newsfragments/3108.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Dual-license PyO3 under either the Apache 2.0 OR the MIT license. This makes the project GPLv2 compatible. \ No newline at end of file diff --git a/newsfragments/3203.added.md b/newsfragments/3203.added.md deleted file mode 100644 index 58c0a24db64..00000000000 --- a/newsfragments/3203.added.md +++ /dev/null @@ -1 +0,0 @@ -Support `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__` in `#[pymethods]` diff --git a/newsfragments/3208.packaging.md b/newsfragments/3208.packaging.md deleted file mode 100644 index 7845c7c8047..00000000000 --- a/newsfragments/3208.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Update MSRV to Rust 1.56. diff --git a/newsfragments/3222.added.md b/newsfragments/3222.added.md deleted file mode 100644 index fde599bced2..00000000000 --- a/newsfragments/3222.added.md +++ /dev/null @@ -1 +0,0 @@ -Simple getitem example showing type-check for possible attribute types \ No newline at end of file diff --git a/newsfragments/3232.removed.md b/newsfragments/3232.removed.md deleted file mode 100644 index d208adb7a63..00000000000 --- a/newsfragments/3232.removed.md +++ /dev/null @@ -1 +0,0 @@ -Remove all functionality deprecated in PyO3 0.18, including `#[args]` attribute for `#[pymethods]`. diff --git a/newsfragments/3237.packaging.md b/newsfragments/3237.packaging.md deleted file mode 100644 index fb69e3da439..00000000000 --- a/newsfragments/3237.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Bump `indoc` dependency to 2.0 and `unindent` to 0.2. diff --git a/newsfragments/3239.packaging.md b/newsfragments/3239.packaging.md deleted file mode 100644 index ed3f7d7e02f..00000000000 --- a/newsfragments/3239.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Switched from syn 1.x to syn 2.x diff --git a/newsfragments/3281.changed.md b/newsfragments/3281.changed.md deleted file mode 100644 index 777ff81531d..00000000000 --- a/newsfragments/3281.changed.md +++ /dev/null @@ -1 +0,0 @@ -Change `PySet::discard` to return `PyResult` (previously returned nothing). diff --git a/newsfragments/3281.fixed.md b/newsfragments/3281.fixed.md deleted file mode 100644 index ce90a50a508..00000000000 --- a/newsfragments/3281.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Handle exceptions properly in `PySet::discard`. diff --git a/newsfragments/3321.changed.md b/newsfragments/3321.changed.md deleted file mode 100644 index 516af9be67a..00000000000 --- a/newsfragments/3321.changed.md +++ /dev/null @@ -1 +0,0 @@ -Optimize conversion of Rust tuples to Python tuples. diff --git a/newsfragments/3330.changed.md b/newsfragments/3330.changed.md deleted file mode 100644 index daa6c348cd5..00000000000 --- a/newsfragments/3330.changed.md +++ /dev/null @@ -1 +0,0 @@ -Change `PyDict::get_item` to no longer suppress arbitrary exceptions (the return type is now `PyResult>` instead of `Option<&PyAny>`), and deprecate `PyDict::get_item_with_error`. diff --git a/newsfragments/3336.added.md b/newsfragments/3336.added.md deleted file mode 100644 index d625be001f1..00000000000 --- a/newsfragments/3336.added.md +++ /dev/null @@ -1 +0,0 @@ -Add FFI symbol `Py_GETENV`. diff --git a/newsfragments/3336.changed.md b/newsfragments/3336.changed.md deleted file mode 100644 index b178cc049c3..00000000000 --- a/newsfragments/3336.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate FFI definitions which are deprecated in Python 3.12. diff --git a/newsfragments/3358.changed.md b/newsfragments/3358.changed.md deleted file mode 100644 index 9cc8176b674..00000000000 --- a/newsfragments/3358.changed.md +++ /dev/null @@ -1 +0,0 @@ -`AsPyPointer` is now `unsafe trait`. diff --git a/newsfragments/3359.added.md b/newsfragments/3359.added.md deleted file mode 100644 index 29ba5b01392..00000000000 --- a/newsfragments/3359.added.md +++ /dev/null @@ -1 +0,0 @@ -Add `as_ptr` and `into_ptr` inherent methods for `Py`, `PyAny`, `PyRef`, and `PyRefMut`. diff --git a/newsfragments/3366.added.md b/newsfragments/3366.added.md deleted file mode 100644 index 9a6a0799e22..00000000000 --- a/newsfragments/3366.added.md +++ /dev/null @@ -1 +0,0 @@ -Add implementations `DoubleEndedIterator` for `PyTupleIterator` and `PyListIterator`. diff --git a/newsfragments/3366.fixed.md b/newsfragments/3366.fixed.md deleted file mode 100644 index 093f863db5d..00000000000 --- a/newsfragments/3366.fixed.md +++ /dev/null @@ -1 +0,0 @@ -The `PyTupleIterator` type returned by `PyTuple::iter` is now public and hence can be named by downstream crates. diff --git a/newsfragments/3374.added.md b/newsfragments/3374.added.md deleted file mode 100644 index d26db978b2a..00000000000 --- a/newsfragments/3374.added.md +++ /dev/null @@ -1 +0,0 @@ -`PathBuf` `FromPyObject` implementation now works on all `os.PathLike` values. \ No newline at end of file diff --git a/newsfragments/3374.fixed.md b/newsfragments/3374.fixed.md deleted file mode 100644 index 830ccb2906e..00000000000 --- a/newsfragments/3374.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Linking of `PyOS_FSPath` on PyPy. \ No newline at end of file diff --git a/newsfragments/3378.changed.md b/newsfragments/3378.changed.md deleted file mode 100644 index 548ab0ce4c4..00000000000 --- a/newsfragments/3378.changed.md +++ /dev/null @@ -1 +0,0 @@ -Add `__builtins__` to globals in `py.run()` and `py.eval()` if they're missing. diff --git a/newsfragments/3379.changed.md b/newsfragments/3379.changed.md deleted file mode 100644 index b5a246eeabe..00000000000 --- a/newsfragments/3379.changed.md +++ /dev/null @@ -1 +0,0 @@ -Sped up FromPyObject::extract for BigInt and BigUint by up to 43% (although mileage may vary depending on int size and sign) diff --git a/newsfragments/3384.added.md b/newsfragments/3384.added.md deleted file mode 100644 index d4732d5d5b3..00000000000 --- a/newsfragments/3384.added.md +++ /dev/null @@ -1 +0,0 @@ -`#[pyclass]` now accepts `rename_all = "renaming_rule"`: this allows renaming all getters and setters of a struct, or all variants of an enum. Available renaming rules are: `"camelCase"`, `"kebab-case"`, `"lowercase"`, `"PascalCase"`, `"SCREAMING-KEBAB-CASE"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"UPPERCASE"`. diff --git a/newsfragments/3385.removed.md b/newsfragments/3385.removed.md deleted file mode 100644 index 5691a4c2401..00000000000 --- a/newsfragments/3385.removed.md +++ /dev/null @@ -1 +0,0 @@ -Removed `IntoPyPointer` trait, `into_ptr` is now an inherent method on most types representing Python objects diff --git a/newsfragments/3387.packaging.md b/newsfragments/3387.packaging.md deleted file mode 100644 index d776b75771f..00000000000 --- a/newsfragments/3387.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Drop support for debug builds of Python 3.7. diff --git a/newsfragments/3389.changed.md b/newsfragments/3389.changed.md deleted file mode 100644 index 2f695c7f044..00000000000 --- a/newsfragments/3389.changed.md +++ /dev/null @@ -1 +0,0 @@ -`PyIterator::from_object` and `PyByteArray::from` now take a single argument of type `&PyAny`, rather than two arguments, `Python` and `AsPyPointer` diff --git a/newsfragments/3391.changed.md b/newsfragments/3391.changed.md deleted file mode 100644 index fd04faaba0c..00000000000 --- a/newsfragments/3391.changed.md +++ /dev/null @@ -1 +0,0 @@ -Replace `AsPyPointer` with `AsRef` as a bound in the blanket implementation of `From<&T> for PyObject` diff --git a/newsfragments/3393.changed.md b/newsfragments/3393.changed.md deleted file mode 100644 index 6d8fd3a9b44..00000000000 --- a/newsfragments/3393.changed.md +++ /dev/null @@ -1 +0,0 @@ -Replace blanket `impl IntoPy for &T where T: AsPyPointer` with implementations of `impl IntoPy` for `&PyAny`, `&T where T: AsRef`, and `&Py`. diff --git a/newsfragments/3396.changed.md b/newsfragments/3396.changed.md deleted file mode 100644 index 03335dec92a..00000000000 --- a/newsfragments/3396.changed.md +++ /dev/null @@ -1 +0,0 @@ -Reuses `std::io::Error` conversion code when converting `std::io::IntoInnerError` to `PyErr` \ No newline at end of file diff --git a/newsfragments/3397.changed.md b/newsfragments/3397.changed.md deleted file mode 100644 index 43abf8bbe71..00000000000 --- a/newsfragments/3397.changed.md +++ /dev/null @@ -1 +0,0 @@ -Pick a relevant `ErrorKind` when building an `io::Error` from a `OSError` subclass. diff --git a/newsfragments/3401.fixed.md b/newsfragments/3401.fixed.md deleted file mode 100644 index b3b79338897..00000000000 --- a/newsfragments/3401.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix memory leak in `PyTypeBuilder::build`. diff --git a/newsfragments/3402.changed.md b/newsfragments/3402.changed.md deleted file mode 100644 index 2328efdedb8..00000000000 --- a/newsfragments/3402.changed.md +++ /dev/null @@ -1 +0,0 @@ -`std::io::Error` cast: Reuses the underlying `PyErr` Python error instead of wrapping it again if the `io::Error` has been built using a Python exception diff --git a/newsfragments/3403.added.md b/newsfragments/3403.added.md deleted file mode 100644 index 69383de1d6b..00000000000 --- a/newsfragments/3403.added.md +++ /dev/null @@ -1 +0,0 @@ -Add FFI definitions `PyObject_GC_IsTracked` and `PyObject_GC_IsFinalized` on Python 3.9 and up (PyPy 3.10 and up). diff --git a/newsfragments/3403.fixed.md b/newsfragments/3403.fixed.md deleted file mode 100644 index 9098773dfb3..00000000000 --- a/newsfragments/3403.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Disable removed FFI definitions `_Py_GetAllocatedBlocks`, `_PyObject_GC_Malloc`, and `_PyObject_GC_Calloc` on Python 3.11 and up. diff --git a/newsfragments/3404.fixed.md b/newsfragments/3404.fixed.md deleted file mode 100644 index b9a6e89e728..00000000000 --- a/newsfragments/3404.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix `ResourceWarning` and crashes related to GC when running with debug builds of CPython. diff --git a/newsfragments/3405.fixed.md b/newsfragments/3405.fixed.md deleted file mode 100644 index 054afbb3de5..00000000000 --- a/newsfragments/3405.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix compile warning for unreachable expression on debug builds before 3.12. diff --git a/newsfragments/3408.added.md b/newsfragments/3408.added.md deleted file mode 100644 index db1a1efe78e..00000000000 --- a/newsfragments/3408.added.md +++ /dev/null @@ -1 +0,0 @@ -Add types for `None`, `Ellipsis`, and `NotImplemented` diff --git a/newsfragments/3427.packaging.md b/newsfragments/3427.packaging.md deleted file mode 100644 index c7fae31ba1b..00000000000 --- a/newsfragments/3427.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Bump `chrono` optional dependency to require 0.4.25 or newer. diff --git a/newsfragments/3446.changed.md b/newsfragments/3446.changed.md deleted file mode 100644 index a258fb4af67..00000000000 --- a/newsfragments/3446.changed.md +++ /dev/null @@ -1 +0,0 @@ -`#[pymodule]` will now return the same module object on repeated import by the same Python interpreter, on Python 3.9 and up. diff --git a/newsfragments/3455.changed.md b/newsfragments/3455.changed.md deleted file mode 100644 index 53944f9a05f..00000000000 --- a/newsfragments/3455.changed.md +++ /dev/null @@ -1 +0,0 @@ -`Err` returned from `#[pyfunction]` will now have a non-None `__context__` if called from inside a `catch` block. diff --git a/newsfragments/3458.changed.md b/newsfragments/3458.changed.md deleted file mode 100644 index 7d283052a8f..00000000000 --- a/newsfragments/3458.changed.md +++ /dev/null @@ -1 +0,0 @@ -Truncate leap-seconds and warn when converting `chrono` types to Python `datetime` types (`datetime` cannot represent leap-seconds). diff --git a/newsfragments/3461.fixed.md b/newsfragments/3461.fixed.md deleted file mode 100644 index 9b59bcd6023..00000000000 --- a/newsfragments/3461.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Some-wrapping of `Option` default arguments will no longer re-wrap `Some(T)` or expressions evaluating to `None`. diff --git a/newsfragments/3471.fixed.md b/newsfragments/3471.fixed.md deleted file mode 100644 index 6e04f25c851..00000000000 --- a/newsfragments/3471.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix `IterNextOutput::Return` not returning a value on PyPy. diff --git a/newsfragments/3484.fixed.md b/newsfragments/3484.fixed.md deleted file mode 100644 index c1f27412acf..00000000000 --- a/newsfragments/3484.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Emit error on invalid arguments to `#[new]`, `#[classmethod]`, `#[staticmethod]`, and `#[classattr]`. diff --git a/newsfragments/3488.packaging.md b/newsfragments/3488.packaging.md deleted file mode 100644 index 5b9263547d4..00000000000 --- a/newsfragments/3488.packaging.md +++ /dev/null @@ -1 +0,0 @@ -Support Python 3.12. diff --git a/newsfragments/3490.fixed.md b/newsfragments/3490.fixed.md deleted file mode 100644 index b7cf1db847d..00000000000 --- a/newsfragments/3490.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Disable `PyMarshal_WriteObjectToString` from `PyMarshal_ReadObjectFromString` with the `abi3` feature. diff --git a/newsfragments/3491.fixed.md b/newsfragments/3491.fixed.md deleted file mode 100644 index 091f6093792..00000000000 --- a/newsfragments/3491.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Emit compile errors instead of ignoring macro invocations inside `#[pymethods]` blocks. diff --git a/newsfragments/3494.added.md b/newsfragments/3494.added.md deleted file mode 100644 index 7055e52a48e..00000000000 --- a/newsfragments/3494.added.md +++ /dev/null @@ -1 +0,0 @@ -Added the Py_mod_multiple_interpreters constant and its possible values. \ No newline at end of file diff --git a/newsfragments/3500.fixed.md b/newsfragments/3500.fixed.md deleted file mode 100644 index 82202564826..00000000000 --- a/newsfragments/3500.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -In Python 3.11 the `_PyFrameEvalFunction` receives a `_PyInterpreterFrame` opaque struct. - diff --git a/newsfragments/3502.added.md b/newsfragments/3502.added.md deleted file mode 100644 index 12109174bc8..00000000000 --- a/newsfragments/3502.added.md +++ /dev/null @@ -1 +0,0 @@ -Added the `PyInterpreterConfig` struct, its constants and `Py_NewInterpreterFromConfig`. \ No newline at end of file diff --git a/newsfragments/3505.changed.md b/newsfragments/3505.changed.md deleted file mode 100644 index 72b85b8e154..00000000000 --- a/newsfragments/3505.changed.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate undocumented `#[__new__]` form of `#[new]` attribute. diff --git a/pyo3-build-config/Cargo.toml b/pyo3-build-config/Cargo.toml index 1af7c115e71..de3189bf220 100644 --- a/pyo3-build-config/Cargo.toml +++ b/pyo3-build-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-build-config" -version = "0.19.2" +version = "0.20.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 62112841e99..7397691e938 100644 --- a/pyo3-ffi/Cargo.toml +++ b/pyo3-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-ffi" -version = "0.19.2" +version = "0.20.0" description = "Python-API bindings for the PyO3 ecosystem" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -38,4 +38,4 @@ generate-import-lib = ["pyo3-build-config/python3-dll-a"] [build-dependencies] -pyo3-build-config = { path = "../pyo3-build-config", version = "0.19.2", features = ["resolve-config"] } +pyo3-build-config = { path = "../pyo3-build-config", version = "0.20.0", features = ["resolve-config"] } diff --git a/pyo3-macros-backend/Cargo.toml b/pyo3-macros-backend/Cargo.toml index d782a7d9dbb..de782f25bfc 100644 --- a/pyo3-macros-backend/Cargo.toml +++ b/pyo3-macros-backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-macros-backend" -version = "0.19.2" +version = "0.20.0" description = "Code generation for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] diff --git a/pyo3-macros/Cargo.toml b/pyo3-macros/Cargo.toml index 5e4177fa372..7e936f0b9d1 100644 --- a/pyo3-macros/Cargo.toml +++ b/pyo3-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-macros" -version = "0.19.2" +version = "0.20.0" description = "Proc macros for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -22,4 +22,4 @@ abi3 = ["pyo3-macros-backend/abi3"] proc-macro2 = { version = "1", default-features = false } quote = "1" syn = { version = "2", features = ["full", "extra-traits"] } -pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.19.2" } +pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.20.0" } diff --git a/pyproject.toml b/pyproject.toml index 1892c2aecf5..70263bcf873 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ exclude = ''' [tool.towncrier] filename = "CHANGELOG.md" -version = "0.19.2" +version = "0.20.0" start_string = "\n" template = ".towncrier.template.md" title_format = "## [{version}] - {project_date}"