3004: Unwrap dynamic error types when inner is simple `PyErr` r=davidhewitt,adamreichold,mejrs a=BlueGlassBlock
This is the first part of suggested improvements in #2998.
This change will make bubbled `PyErr` wrapped in `eyre::Report` / `anyhow::Error` bubble up unchanged, instead of being wrapped in a `PyRuntimeError`.
Co-authored-by: BlueGlassBlock <blueglassblock@outlook.com>
3141: Add BaseExceptionGroup for Python >= 3.11 r=adamreichold a=adriangb
Not sure if this is totally off base, but it looks like it may be this easy to add support for ExceptionGroup?
Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
2980: support `text_signature` on `#[new]` r=adamreichold a=davidhewitt
Closes#2866
This is a breaking change for 0.19.0, because it starts autogenerating `text_signature` for `#[new]`. This could affect runtime behaviour if the user is relying on the class docs at runtime for some reason.
Guide & tests all updated accordingly.
`#[pyclass(text_signature = "...")]` is deprecated by this PR, however if it's set, it will be used in preference to `#[new]`.
(The signature / `text_signature` from `#[new]` will simply be ignored in this case. I figure that when users fix their deprecation warnings by removing `#[pyclass(text_signature = "...")]` then the `#[new]` signatures will start flowing properly, and this is good enough.)
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
3119: Fix crate docs links in python_from_rust.md r=adamreichold a=xcharleslin
Thank you for contributing to pyo3!
Please consider adding the following to your pull request:
- an entry for this PR in newsfragments - see [https://pyo3.rs/main/contributing.html#documenting-changes]
- docs to all new functions and / or detail in the guide
- tests for all new or changed functions
PyO3's CI pipeline will check your pull request. To run its tests
locally, you can run ```cargo xtask ci```. See its documentation
[here](https://github.com/PyO3/pyo3/tree/main/xtask#readme).
Co-authored-by: xcharleslin <4212216+xcharleslin@users.noreply.github.com>
3016: implement Decimal to rust_decimal conversions r=adamreichold a=cardoe
Implement conversion between rust_decimal::Decimal and decimal.Decimal from Python's stdlib. The C API does not appear to be exposed on the Python side so we need to call into it via Python.
Implements #2774
Co-authored-by: Doug Goldstein <cardoe@cardoe.com>
Implement conversion between rust_decimal::Decimal and decimal.Decimal
from Python's stdlib. The C API does not appear to be exposed on the
Python side so we need to call into it via Python.
3115: Update getting_started.md r=adamreichold a=jond01
Update Poetry command to Poetry groups syntax (1.2+).
https://python-poetry.org/docs/cli/#options-4:
> `--dev (-D`): Add package as development dependency. (**Deprecated**, use `-G dev` instead)
Co-authored-by: Jonathan Daniel <36337649+jond01@users.noreply.github.com>
3097: ci: use codecov coverage format r=davidhewitt a=davidhewitt
Newly supported on `cargo-llvm-cov` 0.5.12, might give some more detailed information.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
3111: Rename sequence `.list()` and `.tuple()` to `.to_list()` and `.to_tuple()` r=adamreichold a=davidhewitt
As agreed in https://github.com/PyO3/pyo3/pull/3042#issuecomment-1465229510.
The motivation is that it is an emerging Rust convention for `to_x` to mean "a non-consuming conversion to type x which has some (small) overhead". E.g. `to_string`, `to_owned`.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>